View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Excel VBA - Varible number rows

Ctrl+Home goes to A1 for me

Dim rng as Range
set rng = Range(Range("A1"),Cells.find("="))

rng.Select

Another possibility

Dim rng as Range
set rng = cells.find("=")
rng.CurrentRegion.Select

--
Regards,
Tom Ogilvy


"louismx " wrote in message
...
Hello

I am using Ctl F to find end ( marked by = ) of a block of rows in a
spread sheet. I then use CTL HOME to select from the end to beginning.

I want to use this command as a macro.
The blocks have a variable number of rows ranging 6 to 20 rows.
However when I run as macro it fails when the number of rows in the
block changes.

Any ideas to solve would be appreciated.

Louis


---
Message posted from http://www.ExcelForum.com/