Results 1 to 6 of 6

Thread: [RESOLVED] This isnt working all of a sudden

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2001
    Location
    Washington DC
    Posts
    330

    Resolved [RESOLVED] This isnt working all of a sudden

    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?
    Swoozie
    Somedays you just should not get out of bed.

  2. #2
    PowerPoster Dave Sell's Avatar
    Join Date
    Mar 2004
    Location
    /dev/null
    Posts
    2,961
    To be honest I never use the UsedRange Property anymore because it doesn't seem very reliable.

  3. #3
    Lively Member TheFIDDLER's Avatar
    Join Date
    May 2002
    Location
    here and there and far away
    Posts
    126
    How was your report altered?

    Is the third row of your used range all empty cells?
    -----
    #VBA, VB 6 Professional Edition, Office XP Developper. Excel 97, Excel 2000, Excel XP

    I miss my VIC 20.
    Never should have upgraded to my commodore 64. ...

  4. #4

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2001
    Location
    Washington DC
    Posts
    330
    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.
    Swoozie
    Somedays you just should not get out of bed.

  5. #5
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901
    I googled to make sure, and found that an error exists if you delete a colum. Hope it helps

    http://support.microsoft.com/default...NoWebContent=1

  6. #6

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2001
    Location
    Washington DC
    Posts
    330
    Thanks, I will try to modify that for the empty cells.

    Just in case, any other suggestions?
    Swoozie
    Somedays you just should not get out of bed.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width