Excel VBA - Varible number rows

L

louismx

Hello

I am using Ctl F to find end ( marked by = ) of a block of rows in
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 th
block changes.

Any ideas to solve would be appreciated.

Loui
 
F

Frank Kabel

Hi
you may post your existing macro and describe what you're trying to
achieve. In most cases there's no need for selecting a range
 
T

Tom Ogilvy

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
 
Top