View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
J.E. McGimpsey J.E. McGimpsey is offline
external usenet poster
 
Posts: 493
Default Defining Range Question?

One way:

Const FINDSTR As String = "Record"
Dim found As Range
With ActiveSheet
Set found = Intersect(.UsedRange, _
.Range("C8:J" & Rows.Count)).Find( _
What:=FINDSTR, _
LookIn:=xlValues, _
LookAt:=xlWhole, _
MatchCase:=False)
End With
If Not found Is Nothing Then
MsgBox "Found " & FINDSTR & " At " & found.Address
Else
MsgBox "Did not find " & FINDSTR
End If




In article ,
Michael168 wrote:

How to define the range in vba? I want to search for data in columns "C
to J" from row number 8 until the last row of the active worksheet name
"Record" .