Hello Everyone,
I have a fairly basic problem that I cannot figure out.
I have a range L6:GK6 that has random "V"'s throughout the range. When the "V" is present I would like to copy that value and move it up one row. When that is complete remove the "V" from the original range. Then I would like to shift down 2 rows and repeat this process for a defined number of times.
I have the first part down but cannot figure out how to loop through the offset of 2 rows down.
I have a fairly basic problem that I cannot figure out.
I have a range L6:GK6 that has random "V"'s throughout the range. When the "V" is present I would like to copy that value and move it up one row. When that is complete remove the "V" from the original range. Then I would like to shift down 2 rows and repeat this process for a defined number of times.
I have the first part down but cannot figure out how to loop through the offset of 2 rows down.
VBA Code:
Sub MOVEVACATIONUP()
Dim cell As Range: Set rng = Application.Range("L6:GK6")
For Each cell In rng
If cell.Value = "V" Then
cell.Copy
cell.Offset(-1, 0).PasteSpecial Paste:=xlValues
End If
Next cell
For Each cell In rng
If cell.Value = "V" Then
cell.ClearContents
End If
Next cell
End Sub