+ Reply to Thread
Results 1 to 3 of 3

Do Until Loop - not going into correct if statement?

  1. #1
    Registered User
    Join Date
    09-29-2011
    Location
    Georgia
    MS-Off Ver
    Excel 2007
    Posts
    29

    Question Do Until Loop - not going into correct if statement?

    I have a pretty simple code that should just be rearranging some data into the proper format and then determining whether the data in a column is negative and if so highlighting it red (I know i can do this with conditional formatting, but in this case I need to use a macro). Everything works perfectly until it gets to the second loop - then whether it is negative or not, when I step into the code it goes through the positive if statement.

    Please Login or Register  to view this content.
    Can anyone help?

    Thanks!
    Last edited by sweedey; 10-03-2011 at 04:38 PM.

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,364

    Re: Do Until Loop - not going into correct if statement?

    You're checking and "incrementing" the ActiveCell but you're operating on the range "rng".

    Regards
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Registered User
    Join Date
    09-29-2011
    Location
    Georgia
    MS-Off Ver
    Excel 2007
    Posts
    29

    Re: Do Until Loop - not going into correct if statement?

    Thanks - I'm not sure I completely understand why it wasn't working - but I replaced all the rng 's with ActiveCells and it works now!~

    Erin

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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