Excel VBA - Varible number rows

  • Thread starter Thread starter louismx
  • Start date Start date
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
 
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
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top