Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Offset and Range Selection

I want to go to the last populated cell and then select the next 10 X 6
cells down. I am not sure how do this using offset but it does need to be
variable since my list varies in length.

Ex.

Last cell with a value is A117 ( I can use the end down to get there) I want
to select range (A118:F128)

I have tried several guesses and none have worked so far.


Thanks


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 634
Default Offset and Range Selection

LastRow = ActiveSheet.Cells(Rows.Count, "A").End(xlUp).Row
Set Rng = Cells(LastRow, 1).Resize(10, 6)

Rng now becomes your 10x6 range, though you should try and avoid selecting if at
all possible, but if you really need to then:-

Rng.Select will now do what you want.

--
Regards
Ken....................... Microsoft MVP - Excel
Sys Spec - Win XP Pro / XL 00/02/03

----------------------------------------------------------------------------
It's easier to beg forgiveness than ask permission :-)
----------------------------------------------------------------------------



"Michael" wrote in message
...
I want to go to the last populated cell and then select the next 10 X 6
cells down. I am not sure how do this using offset but it does need to be
variable since my list varies in length.

Ex.

Last cell with a value is A117 ( I can use the end down to get there) I want
to select range (A118:F128)

I have tried several guesses and none have worked so far.


Thanks




---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.605 / Virus Database: 385 - Release Date: 01/03/2004


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,624
Default Offset and Range Selection

One way:

Range("A" & Rows.Count).End(xlUp).Offset(1, 0).Resize(10, 6).Select

Note that this would select A118:F127, not A118:F128.


In article ,
"Michael" wrote:

I want to go to the last populated cell and then select the next 10 X 6
cells down. I am not sure how do this using offset but it does need to be
variable since my list varies in length.

Ex.

Last cell with a value is A117 ( I can use the end down to get there) I want
to select range (A118:F128)

I have tried several guesses and none have worked so far.


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
OFFSET Range Daniel Excel Worksheet Functions 1 October 18th 07 03:12 PM
Narrow Range based on Selection in Another Range David Excel Discussion (Misc queries) 3 July 1st 07 05:12 PM
Identifying a selection of a selection of a range swimfast Excel Worksheet Functions 1 March 1st 07 02:51 AM
Using Offset to name a range Jennifer Excel Worksheet Functions 3 June 15th 05 10:07 AM
range offset Douvid Excel Programming 5 August 20th 03 04:38 PM


All times are GMT +1. The time now is 04:05 AM.

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"