Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Selecting a cell range
I want to be able to select a range of cells where the
bounds of the range are variable. I can go to the first cell with something like: Application.Goto Reference:="T_origin" ActiveCell.Offset(s_row_offs, s_col_offs).Activate I then tried: ActiveCell.Offset(e_row_offs, e_col_offs).Select but this just selects the single cell at (e_row_offs, e_col_offs) from T_origin. I tried a number of other things that I guessed at, but no success. Can someone tell me how I can select all cells in the range (s_row_offs, s_col_offs):(e_row_offs, e_col_offs)? The VB Help file doesn't seem give any information on the application dependent functions such as these. The Excel Help file programming section just gives a copy of the VB Help file. Many thanks. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Selecting a cell range
Note that the resize method won't work for negative values of e_row_offs and e_col_offs.
----- C Petrin wrote: ----- Have a look at the Range Resize property. Something like this should work. Range("T_origin").Offset(s_row_offs, s_col_offs).Resize(e_row_offs, e_col_offs).Select "peterG" wrote in message ... I want to be able to select a range of cells where the bounds of the range are variable. I can go to the first cell with something like: Application.Goto Reference:="T_origin" ActiveCell.Offset(s_row_offs, s_col_offs).Activate I then tried: ActiveCell.Offset(e_row_offs, e_col_offs).Select but this just selects the single cell at (e_row_offs, e_col_offs) from T_origin. I tried a number of other things that I guessed at, but no success. Can someone tell me how I can select all cells in the range (s_row_offs, s_col_offs):(e_row_offs, e_col_offs)? The VB Help file doesn't seem give any information on the application dependent functions such as these. The Excel Help file programming section just gives a copy of the VB Help file. Many thanks. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Selecting a cell range
Good point.
"Edwin Tam" wrote in message ... Note that the resize method won't work for negative values of e_row_offs and e_col_offs. ----- C Petrin wrote: ----- Have a look at the Range Resize property. Something like this should work. Range("T_origin").Offset(s_row_offs, s_col_offs).Resize(e_row_offs, e_col_offs).Select "peterG" wrote in message ... I want to be able to select a range of cells where the bounds of the range are variable. I can go to the first cell with something like: Application.Goto Reference:="T_origin" ActiveCell.Offset(s_row_offs, s_col_offs).Activate I then tried: ActiveCell.Offset(e_row_offs, e_col_offs).Select but this just selects the single cell at (e_row_offs, e_col_offs) from T_origin. I tried a number of other things that I guessed at, but no success. Can someone tell me how I can select all cells in the range (s_row_offs, s_col_offs):(e_row_offs, e_col_offs)? The VB Help file doesn't seem give any information on the application dependent functions such as these. The Excel Help file programming section just gives a copy of the VB Help file. Many thanks. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Selecting the first cell of the last row in a range | New Users to Excel | |||
Selecting the value from a randomly selected cell out of a range | Excel Discussion (Misc queries) | |||
Selecting the first non blank cell in Range | Excel Worksheet Functions | |||
Selecting range in list of range names depending on a cell informa | Excel Discussion (Misc queries) | |||
Selecting a cell in a range | Excel Worksheet Functions |