Results 1 to 4 of 4

Macro to Compare Two sheets, if Match *within* Cell then Update another Cell

Threaded View

  1. #1
    Registered User
    Join Date
    03-11-2013
    Location
    Washington DC
    MS-Off Ver
    Excel 2007
    Posts
    3

    Macro to Compare Two sheets, if Match *within* Cell then Update another Cell

    All,

    I need to write a semi-complicated VB macro that accomplishes the following: It compares two worksheets (named CTP and SRTM). It uses comma separated entries in column B of the CTP sheet and attempts to find a corresponding match in column A of the SRTM sheet. If a match is found, it copies the corresponding entry in Column A of the CTP sheet to Column B of the SRTM sheet.

    I know this may be hard to visualize so I uploaded a mock workbook and an example below to illustrate what needs to be done:

    Example:
    In the CTP Sheet, there are 2 columns. Column A contains a Test Step Number and Column B contains multiple comma separated Control IDs. The first Cell with Control ID entries contains: "IA.2.a, IA.2.b, IA.4.4, PL.2.1". The macro will first take "IA.2.a" and search through column A of the SRTM sheet for a match. If a match is found it will then populate Column B (the Test Step Number) with Column A of the original CTP sheet that had the Test Step Number. So in this case, the number '4' would be copied from the Column A of the CTP sheet into Column B of the SRTM sheet (next to the IA.2.a entry).

    If there's any additional information I can provide I'd be happy to do so. I appreciate it if anyone could provide some general guidelines as I'm relatively new to VB.

    Thanks.
    Attached Files Attached Files

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