Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Excel VBA > Excel VBA
|
Excel VBA Discuss using VBA for Excel programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Excel VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 6th, 2005, 04:25 AM
Friend of Wrox
 
Join Date: Jan 2005
Posts: 1,525
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to crmpicco Send a message via AIM to crmpicco Send a message via MSN to crmpicco Send a message via Yahoo to crmpicco
Default delete all empty cells and move them to the left

I am looking for code that will automatically do this sequence of events for me:

Select the range (D22:M667)
Edit
Go To
Special
Blanks
Edit
Delete
Shift Cells Left

Basically, i want to delete all empty cells and move them to the left.

Thanks.

Picco


www.crmpicco.co.uk
www.crmpicco.co.uk.tt
www.milklemonadechocolate.uk.tt
www.griswolds.uk.tt
www.piccosmini.co.uk.tt
www.morton.uk.tt
__________________
_______________________
Ayrshire Minis - a Mini E-Community
http://www.ayrshireminis.com
http://www.crmpicco.co.uk
 
Old May 6th, 2005, 05:47 AM
Friend of Wrox
 
Join Date: Jan 2005
Posts: 1,525
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to crmpicco Send a message via AIM to crmpicco Send a message via MSN to crmpicco Send a message via Yahoo to crmpicco
Default

Code:
''''''''''''''''''''''''''''''''''''''''''''''''''''
' delete all empty cells in the content range then '
' move all cells to the left                       '
''''''''''''''''''''''''''''''''''''''''''''''''''''
Sub delete_empty_cells_shift_left()
    Range("D22:M666").Select
    Selection.SpecialCells(xlCellTypeBlanks).Select
    Selection.Delete Shift:=xlToLeft
End Sub


www.crmpicco.co.uk
www.crmpicco.co.uk.tt
www.milklemonadechocolate.uk.tt
www.griswolds.uk.tt
www.piccosmini.co.uk.tt
www.morton.uk.tt





Similar Threads
Thread Thread Starter Forum Replies Last Post
LEFT vs LEFT OUTER joxa83 SQL Server 2005 3 September 18th, 2008 03:13 AM
Repeater, repeating empty cells brettdalldorf ASP.NET 1.0 and 1.1 Basics 0 June 16th, 2005 12:01 PM
Delete all empty worksheets crmpicco Excel VBA 2 May 10th, 2005 07:08 AM
delete/ignore empty column crmpicco Excel VBA 1 May 4th, 2005 08:01 AM
move rows to top with cells in columnA filled RED alienscript Excel VBA 2 December 2nd, 2003 12:51 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.