PDA

Click to See Complete Forum and Search --> : [RESOLVED] This isnt working all of a sudden


swoozie
Jul 23rd, 2004, 03:56 PM
ActiveSheet.UsedRange.Columns(3). _
SpecialCells(xlCellTypeBlanks).EntireRow.Delete

I have been using this for a while now to remove empty rows from crystal report that have been exported to excel. Today the report was altered so I needed to alter my code and now that above line deletes everything.

Anyideas?

Dave Sell
Jul 23rd, 2004, 04:08 PM
To be honest I never use the UsedRange Property anymore because it doesn't seem very reliable.

TheFIDDLER
Jul 24th, 2004, 01:48 PM
How was your report altered?

Is the third row of your used range all empty cells?

swoozie
Jul 26th, 2004, 07:11 AM
I used to use column 2, now I have to use column 3. There is definately data in the column, but for some reason usedrange doesnt seem to recognize it.

If anyone knows a better way to delete blank rows I would appreciate it.

dglienna
Jul 27th, 2004, 12:05 AM
I googled to make sure, and found that an error exists if you delete a colum. Hope it helps

http://support.microsoft.com/default.aspx?scid=http://support.microsoft.com:80/support/kb/articles/Q232/0/94.ASP&NoWebContent=1

swoozie
Jul 27th, 2004, 07:20 AM
Thanks, I will try to modify that for the empty cells.

Just in case, any other suggestions?