Results 1 to 2 of 2

Multiple Condition Do Loop

Threaded View

  1. #1
    Registered User
    Join Date
    05-02-2010
    Location
    Houston
    MS-Off Ver
    Excel 2003
    Posts
    5

    Multiple Condition Do Loop

    I have spent sometime searching for why this isn't working but to no avail...

    What I am trying to do is loop through a column of data until condition 1 is met then check if condition 2 is met 4 cells to the left. Below is the code, if I change the "And" to "Or" it works when either condition is met but if it is "And" it doesn't. Thank you for the help!

    Range("G5").Select
    Do
    If Selection.Value = Range("M4") And Selection.Offset(0, -4) = Range("I4") Then
    Range(Selection.Offset(0, -4), Selection).Copy
    Else
    Selection.Offset(1, 0).Select
    End If
    Loop
    Last edited by Leith Ross; 07-01-2011 at 02:25 PM. Reason: Changed Quote Tags to Code Tags

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