Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Remove blank cells from data validation drop down box Jay Excel Worksheet Functions 3 December 8th 09 04:16 PM
remove blank cells - no sorting Luke Excel Worksheet Functions 4 May 14th 08 10:23 PM
how to remove blank cells in excel Landa Excel Discussion (Misc queries) 7 August 13th 06 07:29 AM
Remove blank cells from a range Dave Excel Discussion (Misc queries) 2 January 4th 06 08:29 PM
Deleting blank cells in a selection Novice[_10_] Excel Programming 6 December 24th 03 12:41 AM


All times are GMT +1. The time now is 09:08 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"