Selecting ranges with Cells()

  • Thread starter Thread starter robotman
  • Start date Start date
R

robotman

Can someone tell me how to specify a range with the Cells command?

On the spreadsheet level, you can use OFFSET to not only specify the
offset cell starting point, but also how many cells across and down
you'd like to reference. (i.e. "=OFFSET(A1,0,0,1,5)")

In VBA, the Offset only seems to let you specify the offset cell.

I'd like to be able to specify a range with a single Cells command
like:

Cells(1,1).Offset(0,0,1,5).Select ' Select A1:E1

What syntax would I use to designate a range using Cells?

Thanks!

John
 
You really want to use a range to do what you are asking something like this...

Range(cells(1,1), cells(2,6)).Select
or
Range(cells(1,1), cells(1,1).Offset(1,5)).Select
 
Thanks for the syntax ideas.

Why do you think I need to use Range()?

Currently I use the double Cells() in the Range() command, but this
seems very clunky. I'm trying to simply the code by not needing the
double Cells() commands. I'll try Resize to see if that gives me full
functionality when selecting a range. I'm guessing it has
limitations.

Any other ideas to simply range selections with out using letter (i.e.
"A1") cell-referencing?
 

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