Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Variable Range

Assuming ActiveCell is the upperleft corner of the selection

Selection.Columns(1).Select

would do the same.

if not
Intersect(ActiveCell.EntireColumn,Selection).Selec t

would do it.

--
Regards,
Tom Ogilvy

"Dave" wrote in message
...
This is what I was trying to do:
NRows = Selection.Rows.Count
ActiveCell.Range("A1", "A" & NRows).Select

Thank You
dave


"Tom Ogilvy" wrote:

Try this

Say, as an example, I have a single cell selected and it is e9. Now

what
command would I use so that such and such a range is selected after I

run
the command

or

how would I get the actual row in
ActiveCell.Range("A1:A300")

a: ActiveCell.Row + 300 - 1

or whatever you question actually is.

--
Regards,
Tom Ogilvy


"Dave" wrote:

Sorry for not being clear. I want the row, column range in:
"ActiveCell.Range("A1:A300").Select" to be based on

"Selection.Rows.Count"



"Tom Ogilvy" wrote:

Selection.rows.count means that area is already selected. If you

want to
expand the selection

selection.Resize(selection.rows.count,10).select
to expand to 10 columns same number of rows, or the simple

Selection.Resize(,10).Select

--
Regards,
Tom Ogilvy


"Dave" wrote:

How can the following range statment:

"ActiveCell.Range("A1:A300").Select" be
written for a varialble range based on "Selection.Rows.Count" ?

Thank you
dave




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
Use Sum() with variable range Jeff Excel Worksheet Functions 4 April 7th 09 05:26 AM
select range and put range address in variable [email protected] Excel Programming 2 January 25th 06 01:28 AM
Macro to copy a specified range to a variable range SWT Excel Programming 4 October 21st 05 08:24 PM
setting a range variable equal to the value of a string variable Pilgrim Excel Programming 2 July 1st 04 11:32 PM
Problem trying to us a range variable as an array variable TBA[_2_] Excel Programming 4 September 27th 03 02:56 PM


All times are GMT +1. The time now is 12:11 PM.

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

About Us

"It's about Microsoft Excel"