H
hotherps
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
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