Range addressing question

  • Thread starter Thread starter ian
  • Start date Start date
I

ian

I'm try to select a range/cell in different columns. I can do it for
the cell/range in different rows but can't work out how to do it with
different colums.

eg

Range("br" & i).Select

but if I want to make the column increase or decrease by a variable j
I'm stuck.

Thanks
 
Use offset cmmand like this:

Range("A10:" & Range("A10").Offset(5, 10).Address).Select


pls do rate
 
If you're trying to select a single cell, take a look at .offset().

range("br" & i).offset(0,j).select

..offset(x,y)
will "move" x rows (up or down) and y columns (left or right).

Positive "moves" down and to the right.
Negative "moves" up and to the left.

You may want to look at .resize(), too. It allows you to resize a range to some
other number of rows and columns.

range("BR" & i).offset(0,j).resize(k,l)

would move j columns and end up with a range k rows by l columns.

ps.

I like using: cells(i,"BR") instead of range("BR" & i). I think it's easier to
read.
 

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