Loop every 26 rows and if..

G

Guest

Would appeciate VBA code for a macro that does the following:

My range from Row 2 to Row 4993 has records in sets of 26 rows each.
Procedure:If Activecell (R2, Range name “Startâ€)=0,move 16 columns left to
be at B2, write “A/C closedâ€
Then move 16 columns right (back to column R), 26 rows down (R28) for next
record, repeat procedure

Else move down 26 rows (R28), repeat procedure
And so on until last record at R4968

Thank you,
 
A

Ardus Petus

Sub Test()
Dim irow As Long
For irow = 2 To 4968 Step 26
If Cells(irow, "R").Value = 0 Then
Cells(irow, "B").Value = "A/C closed"
Next irow
End Sub


HTH
 
G

Guest

Norman, yes that did it.
Thank you so much for helping again.

Ardus, once again thank you
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top