View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
Michael168[_61_] Michael168[_61_] is offline
external usenet poster
 
Posts: 1
Default Defining Range Question?


Thank you for your help.

Regards.

Tom Ogilvy wrote:
*A slightly different interpretation.

Dim rng as Range, rng1 as Range, rng2 as Range
With worksheets("Record")
set rng2 = .Range(.Range("A1"),.UsedRange)
set rng = Intersect(rng2,.Range("C:J"))
set rng = rng.offset(7).Resize(rng.rows.count-7)
End with
set rng1 = rng.Find(What:="Data", . . . )
if not rng1 is nothing then
rng1.Select
End if


Replace "Data" with the string/value you are searching for. Add
appropriate
arguments to the Find method.

--
Regards,
Tom Ogilvy

Michael168 wrote in message
...

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" .

Thanks for helping.


------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~View and post usenet messages directly from

http://www.ExcelForum.com/
*



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~View and post usenet messages directly from http://www.ExcelForum.com/