+ Reply to Thread
Results 1 to 6 of 6

Removing blank lines based on first column

  1. #1
    Registered User
    Join Date
    08-25-2005
    Posts
    37

    Removing blank lines based on first column

    I want to delete any row which is "blank" in the first column. When I try this code, even though the Text show Null in debug, the If statement fails. Why?

    Please Login or Register  to view this content.

  2. #2
    Valued Forum Contributor
    Join Date
    08-13-2012
    Location
    Gardony, Hungary
    MS-Off Ver
    Excel 2003
    Posts
    558

    Re: Removing blank lines based on first column

    Hi SWMagic,

    I think a variable has to be declared as a Variant AND have a "null" value at the same time for the IsNull function to return TRUE. Here's an alternative
    Please Login or Register  to view this content.
    or
    Please Login or Register  to view this content.
    or
    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    08-25-2005
    Posts
    37

    Re: Removing blank lines based on first column

    Well, these were good ideas, but none worked.

    Is this statement reading something other than the first column?

    Rng.Item(ix).Text

    I mean it shouldn't matter as the debug declares Text as null.

  4. #4
    Forum Contributor
    Join Date
    09-23-2008
    Location
    Mexico
    Posts
    200

    Re: Removing blank lines based on first column

    Try:
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    08-25-2005
    Posts
    37

    Re: Removing blank lines based on first column

    Nope. It deleted one line but then ignored the others. Seemed like really tight code, too. Sigh.

  6. #6
    Valued Forum Contributor
    Join Date
    08-13-2012
    Location
    Gardony, Hungary
    MS-Off Ver
    Excel 2003
    Posts
    558

    Re: Removing blank lines based on first column

    Can you attach the workbook where the code fails to work?

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1