Suyeon has attended:
Excel Advanced course
Excel VBA Intro Intermediate course
Access Advanced course
HOW TO DELETE EMTPY CELLS
How can i delete empty cells in vba? empty random cells going down? thanks
RE: HOW TO DELETE EMTPY CELLS
Hello Suyeon
Here's a way using the For Each command.
Highlight the cells including the black cells first.
Then if the cell is empty it is deleted (with shift cells up)
Sub DeleteBlanks()
Dim myCell As Range
For Each myCell In Selection
myCell.Select
If myCell.Value = "" Then
myCell.Delete Shift:=xlUp
End If
Next myCell
End Sub
Please let me know if it works, thanks.
Regards
Doug Dunn
Best STL