Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default Select a range within a range

Hi all,

I think I'm making this harder than it really is, but I can't see any
other way to do it. I have a range, where I want to select a number of
rows within it. This range is very large, and I just need to select an
"x" number of rows. here is the code i have.

Dim x As Integer
x = ((intPackNCount * 2) + intPackDCount)

Dim Ra1 As Range
Set Ra1 = Range("Select")

Application.Goto Ra1
Range("(Ra1.Rows(1)):(Ra1.Rows(x))").Select

Is there an easier way to do this? Please help.

Thanks

V

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Select a range within a range

Dim x As Integer
x = ((intPackNCount * 2) + intPackDCount)

Dim Ra1 As Range
Set Ra1 = Range("Select")
Ra1.Resize(x).Select

just to illustrate from the immediate window:

?Range("A1:Z26").Resize(5).Address
$A$1:$Z$5



--
Regards,
Tom Ogilvy

"nxqviet" wrote in message
oups.com...
Hi all,

I think I'm making this harder than it really is, but I can't see any
other way to do it. I have a range, where I want to select a number of
rows within it. This range is very large, and I just need to select an
"x" number of rows. here is the code i have.

Dim x As Integer
x = ((intPackNCount * 2) + intPackDCount)

Dim Ra1 As Range
Set Ra1 = Range("Select")

Application.Goto Ra1
Range("(Ra1.Rows(1)):(Ra1.Rows(x))").Select

Is there an easier way to do this? Please help.

Thanks

V



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
Using VBA to select a range within a range. GoBow777 Excel Discussion (Misc queries) 3 September 13th 09 11:09 PM
How can change range to select active rows instead of :=Range("S10 ldiaz Excel Discussion (Misc queries) 7 August 29th 08 03:52 PM
When entering data into a range of cells, select the entire range. Q Excel Discussion (Misc queries) 0 September 26th 07 04:36 AM
select range and put range address in variable [email protected] Excel Programming 2 January 25th 06 01:28 AM
Compare a selected Range with a Named range and select cells that do not exist PCLIVE Excel Programming 1 October 18th 05 07:09 PM


All times are GMT +1. The time now is 06:53 PM.

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"