Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have some code that runs down Rows 10-377, and it ranges in column
from K to R. The rows always stay the same but the columns need t advance to the right. The way I have it now is repeating all of th same code for new range. I already have a for statement looks like this: For i = 1 To 377 For Each cell In Rows(i).Columns("K:AA") Set rng = Nothing If cell.Value = "QAPK" Then Set rng = cell 'y ?? Exit For End If next sub: For i = 1 To 377 For Each cell In Rows(i).Columns("AI:AJ") Set rng = Nothing If cell.Value = "QAPK" Then Set rng = cell 'y ?? Exit For The only difference is the new column names. How can I tell it to loop through multiple ranges without creating new sub? Thank -- Message posted from http://www.ExcelForum.com |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Find loop doesn't loop | Excel Discussion (Misc queries) | |||
Worksheet_Change - loop within a loop | Excel Programming | |||
How to loop through all ranges in a worksheet | Excel Programming | |||
loop to name ranges | Excel Programming | |||
HELP!!!! Can't stop a loop (NOT an infinite loop) | Excel Programming |