Mega Code Archive

 
Categories / VisualBasic Script / Excel
 

Selecting with SpecialCells

Sub SpecialRange()     Dim TheRange As Range     Dim oCell As Range              Set TheRange = Range("A1:Z200").SpecialCells(__                 xlCellTypeConstants, xlTextValues)              For Each oCell In TheRange             If oCell.Text = "Your Text" Then                 Debug.Print oCell.Address                 Debug.Print TheRange.Cells.Count             End If         Next oCell End Sub