+ Reply to Thread
Results 1 to 8 of 8

Macro to find value "PAA X" but not "Delete Item 14 on PAA X"

  1. #1
    Registered User
    Join Date
    04-26-2011
    Location
    Saint Louis, MO
    MS-Off Ver
    Excel 2003
    Posts
    33

    Macro to find value "PAA X" but not "Delete Item 14 on PAA X"

    Hi Excelers -

    I am working on part of a macro that has me stumped. I need a macro that will search a range of cells for the value "PAA X". (In all cases "X" will be a number from 1-999.) Then when it finds that text I need it to turn the cell bold. Figured that out OK. My problem lies in the fact that some cells contain values like "Delete Item X on PAA X". I want it to ignore any cell that doesn't just say "PAA X".

    Specfically, my macro searches cells D90:D1199. If it happens to run into a header called "PAA 142" in cell D95, I want it to bold cell D95. But if it runs into any other text I want it to do nothing - even if the text is something like "Delete Item 450 on PAA 142".

    Thanks for reading & responding - this is a wonderful forum & SOOOO educational!!
    Last edited by painterartist; 04-27-2011 at 12:12 PM.

  2. #2
    Valued Forum Contributor tlafferty's Avatar
    Join Date
    04-08-2011
    Location
    United States, Tacoma, WA
    MS-Off Ver
    Excel 2010, Excel 2013 Customer Preview
    Posts
    1,112

    Re: Macro to find value "PAA X" but not "Delete Item 14 on PAA X"

    Please post your code and I'll modify it.

    Mostly what I'll be doing is looking to see if the left 4 digits are PAA and a space. I will then look at the right digits (length of string - 4) to see if it's numeric. If so, I will apply bolding.
    Last edited by tlafferty; 04-26-2011 at 06:40 PM.

  3. #3
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Macro to find value "PAA X" but not "Delete Item 14 on PAA X"

    Hello painterartist,

    This macro will bold any cell in the range "D90:D1190" of the active sheet if the cell equals "PAA 142".

    Please Login or Register  to view this content.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  4. #4
    Valued Forum Contributor tlafferty's Avatar
    Join Date
    04-08-2011
    Location
    United States, Tacoma, WA
    MS-Off Ver
    Excel 2010, Excel 2013 Customer Preview
    Posts
    1,112

    Re: Macro to find value "PAA X" but not "Delete Item 14 on PAA X"

    To borrow from Leith above, this code will work according to your specs:
    That is it will bold anything starting with PAA and ending in a number.
    Please Login or Register  to view this content.
    Last edited by tlafferty; 04-26-2011 at 07:08 PM.

  5. #5
    Registered User
    Join Date
    04-26-2011
    Location
    Saint Louis, MO
    MS-Off Ver
    Excel 2003
    Posts
    33

    Re: Macro to find value "PAA X" but not "Delete Item 14 on PAA X"

    Thanks all for the replies! I am learning alot. I would love to post my code tlafferty & try the wonderful suggestions but the file server is down at the moment so I can't access it. I will try these as soon as possible & TRUELY appreciate the input!

  6. #6
    Registered User
    Join Date
    04-26-2011
    Location
    Saint Louis, MO
    MS-Off Ver
    Excel 2003
    Posts
    33

    Re: Macro to find value "PAA X" but not "Delete Item 14 on PAA X"

    The file server came back up & tlafferty I used your solution. It worked like a charm. You are fantastic! Big thanks also to Leith as I learned something new from you too! I am going to use the scale to kiss your reputations, but I don't suppose either of you could tell me where to go to mark this post as solved?

  7. #7
    Valued Forum Contributor tlafferty's Avatar
    Join Date
    04-08-2011
    Location
    United States, Tacoma, WA
    MS-Off Ver
    Excel 2010, Excel 2013 Customer Preview
    Posts
    1,112

    Re: Macro to find value "PAA X" but not "Delete Item 14 on PAA X"

    To mark your thread solved do the following:
    - Go to the first post
    - Click edit
    - Click Advance
    - Just below the word "Title:" you will see a dropdown with the word No prefix.
    - Change to Solve
    - Click Save
    If your question has been satisfactorily addressed, please consider marking it solved. Click the Thread Tools dropdown and select Mark thread as solved.
    Also, you might want to add to the user's reputation by clicking the star icon in the lower left corner of the post with the answer- it's why we do what we do...

    Thomas Lafferty
    Analyst/Programmer

  8. #8
    Registered User
    Join Date
    04-26-2011
    Location
    Saint Louis, MO
    MS-Off Ver
    Excel 2003
    Posts
    33

    Re: Macro to find value "PAA X" but not "Delete Item 14 on PAA X"

    thanks again for everything

+ 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