+ Reply to Thread
Results 1 to 2 of 2

VBA for String search and Calling Sub just for that adjacent cell.

  1. #1
    Registered User
    Join Date
    01-06-2016
    Location
    Houston
    MS-Off Ver
    2013
    Posts
    20

    VBA for String search and Calling Sub just for that adjacent cell.

    Hello to anyone willing to help! This should be simple but not for a newb. like me.

    Over the past week or so I have briefed myself on VBA in a very rough manor. Posted below is the only code I can think of but I do not know how to create a logical range based on the location of where the program finds the string.

    What I am attempting:

    This sample workbook will have a column of dates and a column of statuses per sheet. Each sheet will also have another column to the right of the "status" column that simply outputs the word "Current" for that date(if this is redundant and you would rather search for the current date in that first column that shows all the dates, feel free to ignore this. I only put it in to make it simple for me).

    This program needs to be able to search in the column to the right of the status column for the string "current" and run a sub that copies and pastes that "status" cells value adjacent to it(or just locate the address via the rows date and run the sub for that specific row's "Status" cell if you wanted to ignore the "current" string thing). The Sample will not have the actual formulas in the status cells and only the values I put in for reference but it its the same principle.

    Please Login or Register  to view this content.
    SAMPLE BOOK.xlsm

    Thank You!!

  2. #2
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    5,962

    Re: VBA for String search and Calling Sub just for that adjacent cell.

    Try this - when looking for dates, it is important to have consistent date formats, which your dates did not, using "mm/dd/yy" for some cells, and "m/dd/yy" for others. So I change the date format to be consistent and allow the date finding to proceed. The code does not need your column T formulas, and it loops through the three sheets.

    Please Login or Register  to view this content.
    Last edited by Bernie Deitrick; 01-29-2016 at 05:11 PM.
    Bernie Deitrick
    Excel MVP 2000-2010

+ Reply to 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 a text string and return given text string to adjacent cell
    By hecgroups in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-14-2015, 04:50 AM
  2. [SOLVED] Search for a string and retrieve string from an adjacent cell.
    By djt80 in forum Excel General
    Replies: 5
    Last Post: 01-27-2015, 03:57 PM
  3. Search column for string and date then search adjacent cell and pop up message
    By ftwobtwo in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-06-2014, 09:55 AM
  4. [SOLVED] Search for string, copy adjacent cell
    By omaolain in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 08-05-2014, 10:44 AM
  5. 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
  6. 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
  7. Replies: 4
    Last Post: 09-30-2011, 09:21 AM

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