Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Selecting the first cell of the last row in a range Susan Ramlet New Users to Excel 5 April 3rd 09 04:35 PM
Selecting the value from a randomly selected cell out of a range Steve W. Excel Discussion (Misc queries) 1 June 3rd 08 06:27 PM
Selecting the first non blank cell in Range VBA Noob Excel Worksheet Functions 2 July 24th 06 07:39 PM
Selecting range in list of range names depending on a cell informa Courreges Excel Discussion (Misc queries) 2 June 19th 06 10:59 AM
Selecting a cell in a range Coolboy55 Excel Worksheet Functions 0 August 31st 05 07:17 PM


All times are GMT +1. The time now is 11:56 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"