Solved

VBA to delete all empty cells and move up in usedrange

Posted on 2014-11-12
7
735 Views
Last Modified: 2014-11-14
Hi

i have data and i want to get rid of all empty cells in each columns. i need vba to delete empty cells in columns and move up.

then i have another sheet that also i need delete empty cells but this time move to the left.

thanks.
0
Comment
Question by:Flora
  • 4
  • 3
7 Comments
 
LVL 46

Accepted Solution

by:
Martin Liss earned 500 total points
ID: 40438177
Sub DeleteMoveUp()

    ActiveSheet.UsedRange.SpecialCells(xlCellTypeBlanks).Delete Shift:=xlUp
End Sub

Open in new window

Sub DeleteMoveLeft()

    ActiveSheet.UsedRange.SpecialCells(xlCellTypeBlanks).Delete Shift:=xlToLeft
End Sub

Open in new window

0
 
LVL 6

Author Closing Comment

by:Flora
ID: 40438932
I love you Martin.  this is magic
0
 
LVL 46

Expert Comment

by:Martin Liss
ID: 40438962
I love you Martin.
It's a good thing my wife isn't a jealous woman:)

In any case I'm glad I was able to help.

In my profile you'll find links to some articles I've written that may interest you.
Marty - MVP 2009 to 2014
0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
LVL 6

Author Comment

by:Flora
ID: 40439005
Thanks Martin.

your profile is impressive.  I liked the Using the Debugger  article.  it is so helpful.
0
 
LVL 46

Expert Comment

by:Martin Liss
ID: 40439012
If you want to you can give it a Helpful vote.
0
 
LVL 6

Author Comment

by:Flora
ID: 40442501
surely i can and i will
0
 
LVL 46

Expert Comment

by:Martin Liss
ID: 40442966
Thanks.
0

Featured Post

ScreenConnect 6.0 Free Trial

At ScreenConnect, partner feedback doesn't fall on deaf ears. We collected partner suggestions off of their virtual wish list and transformed them into one game-changing release: ScreenConnect 6.0. Explore all of the extras and enhancements for yourself!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction This Article is a follow-up to my Mappit! Addin Article (http://www.experts-exchange.com/A_2613.html), it was inspired by an email posting I made to EUSPRIG (http://www.eusprig.org/index.htm), I will briefly cover: 1) An overvie…
This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

823 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question