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.

Excel tip:

Conditional Formatting in Excel 2010

If you have lots of data in a spreadsheet, you may find that it is easier to read if you highlight some of the values. This is Conditional Formatting and here's how to use it:

1) Select the data you wish to apply the format to and click Conditional Formatting
2) A list of options will then appear, from this list, choose the format you wish to display e.g. find all cells with a value less than 0
3) Excel will then highlight all of these cells

To remove this: select the highlighted cells, click the drop down on the Conditional Formatting icon and select Clear Rules from selected cells.

View all Excel hints and tips

Connect with us:

0207 987 3777

Call for assistance

Request Callback

We will call you back

Server loaded in 0.09 secs.