Closed Thread
Results 1 to 5 of 5

Search column for string and date then search adjacent cell and pop up message

  1. #1
    Registered User
    Join Date
    11-03-2014
    Location
    Northern Califnornia
    MS-Off Ver
    2010
    Posts
    4

    Search column for string and date then search adjacent cell and pop up message

    I am trying to write VBA for the first time in many years and I am having trouble getting started.
    I am trying write code that will do the following:

    When a cell in column B is changed I want to check to see if it contains the string "ABC" followed by a date (i.e. "ABC7/29/14" or "ABC 7/29/14")

    Where the date format is inconsistent (i.e. sometimes it would be 07/29/2014, sometimes 7/29/14, and sometimes 7-29-14)

    If the cell does contain ABC followed by a date I want to check if that date falls within a date range.

    If the date does fall within that range then I want to check the cell in the same row to the left (column A) to see if it contains the same string "ABC" followed by a date (i.e. "ABC7/29/14" or "ABC 7/29/14")

    If the second cell does contain ABC followed by a date I want to check if that date falls within a second date range.

    If all these conditions are met I want to have a message box pop up.

    Thank you so much in advance. I have written a few things for this and I am just not getting good results or even things that run correctly every time.

    Fiona

  2. #2
    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: Search column for string and date then search adjacent cell and pop up message

    Hello ftwobtwo,

    Welcome to the Forum!

    To help you with this problem, you would need to post your workbook. We need to see how the data is arranged, what formulas you are using, etc. Otherwise, we are just guessing at what you need.

    Please provide before and after examples of your data along with any notes you would like to include.

    If your workbook contains any sensitive information, please redact that information before you post.

    How To Post Your Workbook
    1. At the bottom right of the Reply window, Click the button Go Advanced
    2. At the top of the Your Message Window, in the first row of icons, Click the Paperclip icon.
    3. Click the Add Files button at the top right in the dialog box. This displays the File Manager dialog.
    4. Click the Select Files button at the bottom middle of the dialog.
    5. In the new window Find the file you want to upload, select it, and Click Open.
    6. You will now be back in the File Manager dialog. Click the bottom Middle button Upload File.
    7. Wait until the file has completely uploaded before you exit the File Manager dialog.
    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!)

  3. #3
    Registered User
    Join Date
    11-03-2014
    Location
    Northern Califnornia
    MS-Off Ver
    2010
    Posts
    4

    Re: Search column for string and date then search adjacent cell and pop up message

    I do not have any data or I would have shared it. I am trying to create a form where the user enters information and if that information contains the specific letters ACB followed by a specific date the cell to its left gets checked for the same letters ABC and a different specific date and if both cells contain ABC and the dates specified dates I need it to pop up a message. :/ Not sure what else to give to help.

  4. #4
    Registered User
    Join Date
    11-03-2014
    Location
    Northern Califnornia
    MS-Off Ver
    2010
    Posts
    4

    Re: Search column for string and date then search adjacent cell and pop up message

    I do have this so far.

    Please Login or Register  to view this content.
    I know it isn't beautiful. Thank you for any help.

  5. #5
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Search column for string and date then search adjacent cell and pop up message

    Closed at request of ftwobtwo so it can be re-posted in Commercial Services.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

Closed Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Search for string, copy adjacent cell
    By omaolain in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 08-05-2014, 10:44 AM
  2. Search for a text string and return adjacent cell value for each match
    By ral8088 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 11-21-2013, 09:55 AM
  3. Search for a string value and make adjacent cell True
    By ChuckT in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-28-2012, 03:46 PM
  4. [SOLVED] Search for string across header row, then search for another string down found column
    By TucsonJack in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-14-2012, 02:09 PM
  5. Replies: 1
    Last Post: 07-26-2011, 06:48 AM

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