Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Selecting a range offset from a cell

I want help with the code associated with selecting an area one row down to 4
columns across (the row below the cell and 4 columns wide) from a specific
cell. I don't want to use the EntireRow feature as I only want to see an
area 1 row by 4 columns wide. There is additional info to the right of this
area that I do not want to select. For example, if my cursor is in A1, I want
to be able to select A2:D2. The cursor will not always be in the same cell so
I assume I need to use some sort of a reference with an offset.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 94
Default Selecting a range offset from a cell

Take a look at Offset and Resize. Used in combination, you can select a
desired contiguous block of cells.

Troy

Sub Test1()
Dim rng As Range

Set rng = ActiveCell.Offset(1, 0).Resize(1, 4)
rng.Select
End Sub

"Beeegr8" wrote in message
...
I want help with the code associated with selecting an area one row down to
4
columns across (the row below the cell and 4 columns wide) from a
specific
cell. I don't want to use the EntireRow feature as I only want to see an
area 1 row by 4 columns wide. There is additional info to the right of
this
area that I do not want to select. For example, if my cursor is in A1, I
want
to be able to select A2:D2. The cursor will not always be in the same cell
so
I assume I need to use some sort of a reference with an offset.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 783
Default Selecting a range offset from a cell

Beeegr8 wrote:
I want help with the code associated with selecting an area one row down to 4
columns across (the row below the cell and 4 columns wide) from a specific
cell. I don't want to use the EntireRow feature as I only want to see an
area 1 row by 4 columns wide. There is additional info to the right of this
area that I do not want to select. For example, if my cursor is in A1, I want
to be able to select A2:D2. The cursor will not always be in the same cell so
I assume I need to use some sort of a reference with an offset.


No need for the Offset function:

ActiveCell(2).Resize(, 4).Select

Alan Beban
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
Sum variable range of column entries in offset cell Struggling in Sheffield[_2_] New Users to Excel 2 October 12th 09 09:11 PM
Sum variable range of column entries in offset cell Struggling in Sheffield[_2_] New Users to Excel 5 October 10th 09 05:16 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
Offset Function works in cell, not in named range DragonslayerApps Excel Worksheet Functions 0 July 25th 05 04:39 PM
Selecting cell using range.offset presence76[_3_] Excel Programming 2 June 9th 04 03:46 PM


All times are GMT +1. The time now is 09:06 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"