Public Schedule Face-to-Face & Online Instructor-Led Training - View dates & book

STL - Formerly Best Training Solutions Through Learning
TrustPilot
Excellent
Request Callback We will call you back
0207 987 3777 Call for assistance
Your Basket Basket is empty
how to delete emtpy

Forum home » Delegate support and help forum » Microsoft Excel Training and help » HOW TO DELETE EMTPY CELLS

HOW TO DELETE EMTPY CELLS

ResolvedVersion 2007

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

Wed 25 Jul 2012: Automatically marked as resolved.

Connect with us:

0207 987 3777

Call for assistance

Request Callback

We will call you back

Server loaded in 0.1 secs.