PC Review


Reply
Thread Tools Rate Thread

delete blank rows with functions

 
 
daphoenix
Guest
Posts: n/a
 
      26th Jun 2008
I have blank rows that I want to remove from the worksheet, i use the
following code to do that, but it does not delete the rows in which the cells
of the row have a function. I have a function that returns a value, if it
does not return the value it is blank.

Public Sub DeleteBlankRows()
On Error Resume Next
Columns(2).SpecialCells(xlCellTypeBlanks).EntireRow.Delete
On Error GoTo 0
End Sub


I would like to know if there is a way to delete those rows with the blank
functions?
 
Reply With Quote
 
 
 
 
Ron de Bruin
Guest
Posts: n/a
 
      26th Jun 2008
Hi daphoenix

You can loop and test for ""
http://www.rondebruin.nl/delete.htm

See the examples below the first macro

You can use

If .Value = "" Then .EntireRow.Delete
'This will delete each row if the cell is empty or have a formula that evaluates to ""

Or use EasyFilter
There is a option in the add-in to filter for "" and delete the rows
http://www.rondebruin.nl/easyfilter.htm



--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"daphoenix" <(E-Mail Removed)> wrote in message news:4BE32B15-2D75-48F1-B45F-(E-Mail Removed)...
>I have blank rows that I want to remove from the worksheet, i use the
> following code to do that, but it does not delete the rows in which the cells
> of the row have a function. I have a function that returns a value, if it
> does not return the value it is blank.
>
> Public Sub DeleteBlankRows()
> On Error Resume Next
> Columns(2).SpecialCells(xlCellTypeBlanks).EntireRow.Delete
> On Error GoTo 0
> End Sub
>
>
> I would like to know if there is a way to delete those rows with the blank
> functions?

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
delete the non blank rows Harn88 Microsoft Excel Programming 2 18th Nov 2008 10:34 PM
Delete Rows if any cell in Column H is blank but do not Delete Fir =?Utf-8?B?bWFuZmFyZWVk?= Microsoft Excel Programming 4 28th Sep 2007 05:20 PM
How do I delete blank rows (rows alternate data, blank, data, etc =?Utf-8?B?bmNvY2hyYXg=?= Microsoft Excel Misc 2 27th Jun 2007 04:40 AM
Delete Blank Rows =?Utf-8?B?aXIyNjEyMTk3Mw==?= Microsoft Excel Programming 3 28th Aug 2006 08:25 PM
Delete blank row only if 2 consecutive blank rows =?Utf-8?B?QW15?= Microsoft Excel Programming 2 21st Oct 2004 05:24 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:59 PM.