Hi,
Please help with the below code, which removes the blank cells, by replacing
the values from the below cells to the blank cells, and makes values in sequence for a cloumn.
Private Sub CommandButton3_Click()
Dim rng As Range, counter As Integer, i As Integer, j As Integer
Set rng = Range("A1:A12")
counter = 0
For i = 1 To rng.count
If Cells(i, 1).Value = "" Then
For j = i + 1 To rng.count
If Cells(j, 1).Value = "" Then
counter = j
End If
Next j
Cells(i, 1).Value = Cells(counter + 1).Value
End If
Next i
End Sub
Bookmarks