+ Reply to Thread
Results 1 to 5 of 5

Deleting Specific Rows

  1. #1
    Registered User
    Join Date
    09-26-2007
    Posts
    9

    Deleting Specific Rows

    My data looks as follows:

    B1 Heading
    B2 717/123
    B3 737/45
    B4 738/78
    B5 745/453
    B6
    ...

    I have to search for the characters before '/' and change their values. I have got this part working (see code).
    For the values that I don't define in my code, I want to delete that entire row, or if the column is blank, I want to delete that entire row as well. When I tried doing this (Case Else), it does not work

    Please Login or Register  to view this content.
    Anything I am doing wrong? or if you have a better way of doing this, please let me know

  2. #2
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Maybe

    Please Login or Register  to view this content.
    VBA Noob
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  3. #3
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678
    Rather than retrieving cells from the range collection, use a loop, traversing BACKWARDS.
    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    09-26-2007
    Posts
    9
    Quote Originally Posted by shg
    Rather than retrieving cells from the range collection, use a loop, traversing BACKWARDS.
    Is there an advantage in going backwards?

  5. #5
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678
    Yes. Think about what row you're referencing when you delete rows in some iterations, and increment a row index on every iteration.

+ 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