Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Sum variable range of column entries in offset cell | New Users to Excel | |||
Sum variable range of column entries in offset cell | New Users to Excel | |||
Selecting range in list of range names depending on a cell informa | Excel Discussion (Misc queries) | |||
Offset Function works in cell, not in named range | Excel Worksheet Functions | |||
Selecting cell using range.offset | Excel Programming |