Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default range selection object code

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default range selection object code

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
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
VBA Code User Range Selection jimbo Excel Discussion (Misc queries) 5 January 5th 10 02:31 AM
Selection.Cut Selection.Offset(1, 0) HOW to understand this code CAPTGNVR[_2_] Excel Programming 4 April 22nd 08 12:25 AM
Object Variable Not Set Error on Selection object Jean Excel Worksheet Functions 3 July 24th 06 06:45 PM
Object Type of a selection... counting rows in a selection Acid-Sky[_2_] Excel Programming 3 August 23rd 05 09:53 AM
Range selection code in a macro Floss Excel Programming 1 December 30th 03 01:05 AM


All times are GMT +1. The time now is 02:16 PM.

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"