Thread: [Solved] deleting blanks and commas
View Single Post
 
Old 03-01-2017, 12:43 PM
NoSparks NoSparks is offline Windows 7 64bit Office 2010 64bit
Excel Hobbyist
 
Join Date: Nov 2013
Location: British Columbia, Canada
Posts: 831
NoSparks is just really niceNoSparks is just really niceNoSparks is just really niceNoSparks is just really niceNoSparks is just really nice
Default

Hey..... stop with that old man stuff, I'm an Old Age Pensioner too ya know.

Except for the 33 and HorizontalAlignment this is what I had prior to seeing your last post.

xlBlanks is an built in constant.
In the vba environment, place your cursor within SpecialCells and hit F1 to find out things like this.

You could remove the commas to make those cells blank, then delete.
Code:
With Range("A33", Cells(Rows.Count, "A").End(xlUp))
    .Replace What:=",", Replacement:=""
    .SpecialCells(xlBlanks).Delete Shift:=xlUp
    .HorizontalAlignment = xlRight
End With
Reply With Quote