Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Looking for the proper object code for using relative address logic (like
offset) in the range selection object to select multiple fields and rows (block of cells) where I don't know the exact cell reference but only an offset value. I use xldirection all the time but that only goes to the end of a continuous block of cells with values. I need code that will allow me to grab, say 2 or 3 columns of data at a time. -- thanks, Biologist Mike |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I think you are looking for the Resize method. Consider this example. Let's
say you wanted to select a range 3 cells wide by 5 cells high where the upper left cell of that range was to be offset from the active cell 2 rows down and 4 columns over... ActiveCell.Offset(2, 4).Resize(5, 3).Select So, if C3 was your active cell, then the above statement would select G5:I9. -- Rick (MVP - Excel) "Biologist Mike" wrote in message ... Looking for the proper object code for using relative address logic (like offset) in the range selection object to select multiple fields and rows (block of cells) where I don't know the exact cell reference but only an offset value. I use xldirection all the time but that only goes to the end of a continuous block of cells with values. I need code that will allow me to grab, say 2 or 3 columns of data at a time. -- thanks, Biologist Mike |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
VBA Code User Range Selection | Excel Discussion (Misc queries) | |||
Selection.Cut Selection.Offset(1, 0) HOW to understand this code | Excel Programming | |||
Object Variable Not Set Error on Selection object | Excel Worksheet Functions | |||
Object Type of a selection... counting rows in a selection | Excel Programming | |||
Range selection code in a macro | Excel Programming |