Reputation: 51
Got any Way to Arrange The data like the picture attached?
*the requirement is when the Column A Cell is empty then Column B Value will Move to previous not Empty Column A Row at Column B Cell.
Upvotes: 0
Views: 28
Reputation: 41
Try this code
Sub Macro1()
Dim i As Long
i = 1
Do Until Cells(i, 2) = ""
If Cells(i, 1) = "" Then
On Error Resume Next
Cells(i - 1, 2) = Cells(i - 1, 2) & "," & Cells(i, 2)
Cells(i, 2).EntireRow.Delete
i = i - 1
End If
i = i + 1
Loop
End Sub
Upvotes: 1