Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Not sure if this is what you want, but it seems to do what you are asking, at least some of it.</p> <p><a href="http://www.ozgrid.com/VBA/special-cells.htm" rel="nofollow">http://www.ozgrid.com/VBA/special-cells.htm</a></p> <p>It's the <code>range.specialcells</code> method.</p> <p>It returns a range that contains only constants, or only formulas, etc.</p> <p>An example of how this code would be used is shown below:</p> <pre><code>Sub CheckForConstants() Dim x As Range Set x = Selection.SpecialCells(xlCellTypeConstants, xlNumbers) MsgBox "address of cells that contain numbers only is " &amp; x.Address Set x = Selection.SpecialCells(xlCellTypeConstants) MsgBox "address of cells that contain constant of any type is " &amp; x.Address End Sub </code></pre> <p>You select a range and then execute this macro and it will return the address of those cells that meet the requirements.</p> <p>The first x looks for cells that contains numbers only. The second x looks for cells that contains any constants</p> <p>The range in this case was selection, but you can set to what you want, i.e. range("a1:b5"), etc.</p> <p>I went back to the worksheet and used the goto special method.</p> <p>Apparently it also uses the range.special method.</p> <p>I used the record macro option and this is what I got.</p> <pre><code>Selection.SpecialCells(xlCellTypeConstants, 23).Select Range("M7").Select Selection.SpecialCells(xlCellTypeFormulas, 23).Select Range("I6:J16").Select Selection.SpecialCells(xlCellTypeConstants, 1).Select Range("L9").Select ActiveWindow.ScrollWorkbookTabs Position:=xlFirst Sheets("CP").Select Application.CutCopyMode = False Range("I21").Select ActiveSheet.DrawingObjects.Select Application.Goto Reference:="GoToSpecialRoutine" </code></pre> <p>The goto special feature on the worksheet uses the special cells method for some of what it does.</p> <p>It also uses others as well. In the last 5 lines of codes I changed worksheet and asked it to go to objects.</p> <p>It doesn't really go to them. It just selects them.</p> <p>worksheet CP contained objects and it used the code in the last 3 lines to select all the objects on the worksheet.</p> <p>Best bet to see the code behind goto special is to record a macro and then use the goto / special feature in the worksheet.</p> <p>When finished, Stop recording and view the macro you recorded.</p> <p>I don't know of any other features to select by type of cell, but I'm just a newby so it could be there very easily and not be known by me.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload