+ Reply to Thread
Results 1 to 6 of 6

Deleting Entired Rows Based on Data Conditions

  1. #1
    Registered User
    Join Date
    03-27-2008
    Posts
    75

    Deleting Entired Rows Based on Data Conditions

    Hi Everyone- I have been trying get a macro working. Basically I have a list in column H like this (about 1000-1200 rows):

    open
    close
    open
    open
    close
    open

    I need to apply a set of rules to them:

    1) For any 'double opens', delete the first value

    eg)
    open - delete this entire row
    open
    close

    2) For any 'double closes', delete the second value

    eg)
    open
    close
    close - delete this entire row
    open

    Any help would be much appreciated.

    Thanks.
    Last edited by starbwoy; 05-22-2008 at 01:55 PM.

  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
    starbwoy,

    Please read forum rules below and then add the link to the other excel forum

    Many thanks

    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
    Registered User
    Join Date
    03-27-2008
    Posts
    75
    Sorry. Will not double post.

  4. #4
    Forum Contributor
    Join Date
    04-30-2008
    Posts
    105
    Are there ever any cases where you'll have three or more consecutive cells in column H that equal "open" or "close"? If so, this code won't work properly:


    Please Login or Register  to view this content.
    But if you're only concerned with doubles, this should do the trick. It starts at H2 and works its way down (I assume H1 has a heading, if not, adjust it accordingly).
    Last edited by fecurtis; 05-22-2008 at 02:39 PM.

  5. #5
    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
    No issue with cross posting as long as you add the link

    BTW you still need to add the link

    VBA Noob

  6. #6
    Registered User
    Join Date
    03-27-2008
    Posts
    75
    Fecurtis- Thanks for your help!

    Here is the link to the other forum

    http://www.mrexcel.com/forum/showthread.php?t=321100

+ 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