Add these commands after your counter is increased
If (counter Mod 6) = 1 And counter > 1 Then
yval = yval + 140
End If
It sounds like you are intending to use a Do type loop
Here is a way to loop using a For type loop where you get the end row number before you start the loop
Sub ddddd()
Dim counter As Integer
Dim yval As Integer
Dim iLastRow As Integer
yval = 20
iLastRow = Cells(Rows.Count, "a").End(xlUp).Row
For counter = 1 To iLastRow Step 1
If (counter Mod 6) = 1 And counter > 1 Then
yval = yval + 140
End If
Next counter
For an explanation of why I recomend For loops over Do loops see my last 2 messages at
http://www.excelforum.com/showthread.php?t=591910&page=2
End Sub
Bookmarks