+ Reply to Thread
Results 1 to 4 of 4

Loop until activcell contains...

  1. #1
    Registered User
    Join Date
    08-28-2012
    Location
    Minnesota
    MS-Off Ver
    Excel 2010
    Posts
    11

    Loop until activcell contains...

    I have searched far and wide but maybe I'm just trying to use the wrong type of loop. I want my loop to apply conditional formatting to every line of an invoice spreadsheet until it gets to a line for the customer signature, but the text in this line is not the same in every spreadsheet, so I just want it to stop when it gets to a line containing the text "customer". Can anyone help me out?

    Please Login or Register  to view this content.
    Thanks in advance.

  2. #2
    Forum Contributor wallyeye's Avatar
    Join Date
    05-06-2011
    Location
    Arizona
    MS-Off Ver
    Office 2010, 2007
    Posts
    308

    Re: Loop until activcell contains...

    You can try this out:

    Please Login or Register  to view this content.
    It is a bit longer code, but does less processing. Change the Set rngStart line to point to the starting cell of the data on your worksheet. It first finds "Customer" in the given column, then assigns a range object to the cells from rngStart to the cell right above "Customer". It deletes any existing conditional formatting, then adds new conditional formatting as your code does.

  3. #3
    Registered User
    Join Date
    08-28-2012
    Location
    Minnesota
    MS-Off Ver
    Excel 2010
    Posts
    11

    Re: Loop until activcell contains...

    That looks awesome! It doesn't seem to be working though. My data starts is D19 and then the text to make it stop is also in that column; would that need to be in there?
    Thanks,
    Alex

  4. #4
    Forum Contributor wallyeye's Avatar
    Join Date
    05-06-2011
    Location
    Arizona
    MS-Off Ver
    Office 2010, 2007
    Posts
    308

    Re: Loop until activcell contains...

    Change the Set rngStart line to point to D19 instead of A2...

+ 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