Excel 2003 - VBA - Cell Select

  • Thread starter Thread starter Craig Brandt
  • Start date Start date
C

Craig Brandt

I am driving a sheet with macros and sometimes cells are manipulated using
offset. This can get very convoluted and doesn't always work for me.

The current issue is as follows:

I would like to select a cell, then use the information in that cell and
others in the same row. Once I have completed cell data manipulation, I
would like to select the first 25 cells in that row and change the
background color to indicate that this is new data.
In VBA, how do I select a range when I do not know the row, I just work off
activecell and offset.



Thanks,

Craig
 
If you are working off the active cell, then you can get the row from
ActiveCell.Row, so you can use this statement to select the first 25 cells
in the active cell's row...

Cells(ActiveCell.Row, 1).Resize(0, 25).Select

Rick
 
I bet you didn't want to resize it to 0 rows <vbg>:

Cells(ActiveCell.Row, 1).Resize(1, 25).Select
 
Thanks Guys!

I tried the first sample and it didn't work but you really answered my
question by introducing me to "ActiveCell.Row". My result was:
Range(Cells(ActiveCell.row,1),Cells(ActiveCell.row,25)).Select
Works like a charm.

Craig

Rick Rothstein (MVP - VB) said:
Nope... not really. <lol>

Thanks for catching that.

Rick
 
Back
Top