LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Looping over non-contiguous column selection

I'd like to loop over all columns (or rows) in a non-contiguous selection in
one of my macros.

I can already do it rather easily for a contiguous column selection by
referencing the Selection.Column property and the Selection.Columns.Count
property as in the following ...

'get DataColumn information
FirstDataColumn = Selection.Column
LastDataColumn = FirstDataColumn + Selection.Columns.Count - 1
For k = FirstDataColumn To LastDataColumn
....
next k

I'd like to do the same thing for a non-contiguous column/row selection.

Any help would be greatly appreciated.

Thanks,

Jim


 
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
Non-contiguous selection Kay Excel Discussion (Misc queries) 3 May 9th 08 05:20 AM
Multiple Selection of Non-Contiguous Data [email protected] Excel Programming 0 January 15th 07 12:41 AM
Contiguous Column Selection using variables Leslie Payne Excel Programming 3 October 14th 04 04:08 PM
Non-contiguous selection PBezucha[_2_] Excel Programming 1 July 13th 04 03:22 PM
Help : Code for selection non-contiguous cells Majeed Excel Programming 1 November 24th 03 06:49 PM


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