Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Remove Blank Cells in a Selection
I have a range selected in a Column and am trying to delete the Blan cells out. The following code works if there are blank cells in th range, but if there are not it gives an error. Selection.SpecialCells(xlCellTypeBlanks).Delete Shift:=xlUp Is there a way of doing it so it doesn't give an error, or should just do On Error Resume Next for this section of the macro -- Krage ----------------------------------------------------------------------- Krager's Profile: http://www.excelforum.com/member.php...fo&userid=2093 View this thread: http://www.excelforum.com/showthread.php?threadid=40170 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Remove Blank Cells in a Selection
Krager Wrote: I have a range selected in a Column and am trying to delete the Blank cells out. The following code works if there are blank cells in the range, but if there are not it gives an error. Selection.SpecialCells(xlCellTypeBlanks).Delete Shift:=xlUp Is there a way of doing it so it doesn't give an error, or should I just do On Error Resume Next for this section of the macro? On Error Resume Next Selection.SpecialCells(xlCellTypeBlanks).Delete Shift:=xlUp On Error GoTo 0 -- Bob Phillips ------------------------------------------------------------------------ Bob Phillips's Profile: http://www.excelforum.com/member.php...o&userid=26952 View this thread: http://www.excelforum.com/showthread...hreadid=401709 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Remove Blank Cells in a Selection
Thanks, works perfectly -- Krager ------------------------------------------------------------------------ Krager's Profile: http://www.excelforum.com/member.php...o&userid=20936 View this thread: http://www.excelforum.com/showthread...hreadid=401709 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Remove blank cells from data validation drop down box | Excel Worksheet Functions | |||
remove blank cells - no sorting | Excel Worksheet Functions | |||
how to remove blank cells in excel | Excel Discussion (Misc queries) | |||
Remove blank cells from a range | Excel Discussion (Misc queries) | |||
Deleting blank cells in a selection | Excel Programming |