Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Loop through ranges columns

I'm using a For next loop to determine the number of rows and columns m
code should run in.

What If I have multiple ranges of columns that need to be ru
indepenedently. Let's say A:K then L:R then S:Z with the rows at
constant of 1 to 100

For Each Cell in Range ("A:K") ??How do I state the next range?

Does there need to be a Loop at the bottom of the code?


Thanks:confused

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 201
Default Loop through ranges columns

I don't understand what you're doing but this is how you would get one For
loop to operate on those 3 ranges.
Do something like this:
Dim i as Range
Set TheWholeRng=Union(Range("A1:K100"),Range
("L1:R100"),Range("S1:Z100"))
For Each i In TheWholeRng
'What you want to do with each cell
Next i

"hotherps " wrote in message
...
I'm using a For next loop to determine the number of rows and columns my
code should run in.

What If I have multiple ranges of columns that need to be run
indepenedently. Let's say A:K then L:R then S:Z with the rows at a
constant of 1 to 100

For Each Cell in Range ("A:K") ??How do I state the next range?

Does there need to be a Loop at the bottom of the code?


Thanks


---
Message posted from http://www.ExcelForum.com/



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
loop over columns kizzie Excel Discussion (Misc queries) 4 August 10th 05 01:31 PM
Loop through ranges hotherps[_30_] Excel Programming 3 February 29th 04 08:35 AM
How to loop through all ranges in a worksheet Nanette[_2_] Excel Programming 6 January 12th 04 07:30 PM
loop to name ranges spence[_3_] Excel Programming 1 January 8th 04 05:16 PM
How do I delete rows and columns in With With End Loop? Bob Benjamin Excel Programming 3 November 16th 03 12:26 AM


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