+ Reply to Thread
Results 1 to 6 of 6

Loop to Delete Rows and Shift Up on Cell Value

  1. #1
    Registered User
    Join Date
    05-29-2013
    Location
    Canada
    MS-Off Ver
    Excel 2007
    Posts
    37

    Loop to Delete Rows and Shift Up on Cell Value

    Hi,

    I'm trying to figure out a way to loop through rows H23 to AI23 all the way down and deleting any rows which don't contain the value "Yes" in the same row on column G.
    I also want to shift the bottom row up.

    In simple terms, I want the code to check whether the row contains "Yes" in column G and if it doesn't, then delete it and move the bottom row up into its position, but if it does, move on to the next row and repeat the same process until Activecell.Value = "".

    I just started learning macros a couple days ago so i apologize if this question is a bit elementary (i'm not very experienced with loops)

  2. #2
    Valued Forum Contributor
    Join Date
    11-20-2012
    Location
    Seattle, WA USA
    MS-Off Ver
    Excel 2010
    Posts
    597

    Re: Loop to Delete Rows and Shift Up on Cell Value

    i use this alot...
    http://www.rondebruin.nl/win/s4/win001.htm

    anytime i'm doing any loop, i reference this first...

  3. #3
    Valued Forum Contributor
    Join Date
    11-20-2012
    Location
    Seattle, WA USA
    MS-Off Ver
    Excel 2010
    Posts
    597

    Re: Loop to Delete Rows and Shift Up on Cell Value

    i use this alot...
    http://www.rondebruin.nl/win/s4/win001.htm

    anytime i'm doing any loop, i reference this first...

    sorry i don't get the part about moving up the bottom row part

  4. #4
    Valued Forum Contributor
    Join Date
    11-20-2012
    Location
    Seattle, WA USA
    MS-Off Ver
    Excel 2010
    Posts
    597

    Re: Loop to Delete Rows and Shift Up on Cell Value

    ps h23:ai23 are in the same row??

  5. #5
    Valued Forum Contributor
    Join Date
    11-20-2012
    Location
    Seattle, WA USA
    MS-Off Ver
    Excel 2010
    Posts
    597

    Re: Loop to Delete Rows and Shift Up on Cell Value

    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    05-29-2013
    Location
    Canada
    MS-Off Ver
    Excel 2007
    Posts
    37

    Re: Loop to Delete Rows and Shift Up on Cell Value

    Hey Scott,

    Thanks a lot for the help. Your code gave me the gist of what I wanted to do. I tweaked it slightly to fit my needs (since I wasn't able to explain myself in my OP). Btw, that's a great website!

    -Lauren

+ 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