I have a small script that sort of does what I need it to do, but I'm afraid at some point there will be more than 4 characters in a cell and I don't want to delete it. The logic that I want to employ is as follows:
If any cell in BB1:BB10 contains ONLY Chr(10) then move the contents of the cells below up one cell. Something like this
Public Sub CheckHisMethod()
Dim i As Integer
i = 1
For i = 10 To 1 Step -1
If Excel.ActiveSheet.Range("BB" & i).Value = Chr(10) Then ' or =vblf or =chr$(10)
Excel.ActiveSheet.Range("BB" & i).Delete Shift:=xlUp
End If
Next i
MsgBox "Done"
End Sub
But...I don't want to delete the Chr(10) from each cell, I only want to delete the cell, and move the cell below up one cell, if the cell contains ONLY Chr(10). How can I do that?