Cell as range

  • Thread starter Thread starter Grace
  • Start date Start date
G

Grace

I am having trouble with all the help I'm getting about expanding a range
and I think it has to do with the fact that, when I have selected a single
cell, I am assuming that such is a range that can be expanded. Probably, it
is not. So, kindly tell me how to expand from a cell location that I have
selected to a "range", say by adding five more columns to the right. At
that point, I assume, I will have a range and, from there, I think I can
figure the rest out myself.

Thanks,
Grace
 
Hi Grace
also a single cell is an Range. try something like the following
sub foo()
dim rng as range
set rng = activesheet.range("B1")
rng.resize(1,6)
rng.value="myrange"
end sub
 
ActiveCell.Resize(1,5) will be 5 cells in 1 row

ActiveCell.Resize(1,6) will be 6 cells in 1 rows (the original cell and 5
additional cells to the right.


If you will have data below that cell that you want to select

Range(ActiveCell,ActiveCell.End(xldown)).Resize(,6).Printout

change the 6 to a 5 if you want a total of 5 columns.
 
Thanks Tom and Frank!
Grace

Tom Ogilvy said:
ActiveCell.Resize(1,5) will be 5 cells in 1 row

ActiveCell.Resize(1,6) will be 6 cells in 1 rows (the original cell and 5
additional cells to the right.


If you will have data below that cell that you want to select

Range(ActiveCell,ActiveCell.End(xldown)).Resize(,6).Printout

change the 6 to a 5 if you want a total of 5 columns.

--
Regards,
Tom Ogilvy

Probably,
 

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