+ Reply to Thread
Results 1 to 3 of 3

macro to check if a value exist in a column and add it if it does not

  1. #1
    Registered User
    Join Date
    06-30-2021
    Location
    SG
    MS-Off Ver
    365
    Posts
    2

    macro to check if a value exist in a column and add it if it does not

    Hi experts,

    I need help from you regarding excel vba. I'm a beginner in excel macro and I tried out many codes on the situation i have, it seems not working well.

    I have 3 different files. I need a macro to go through the values row by row in column A & B in the "station_A" and "station _B" file respectively, and check if the value already exist in column A & B in "Master" file (check through the entire column to see if has repeated value). If it does, then show the address for that cell and continue on to the next one, if it doesn't exist then add both column A & B values in the "Master" sheet .

    For example, I have a macro in "station_A" file. The first cell value in column A & B are "equipment 1" and "station A", the macro will check the values against the "Master" file. If the values already exist in the "Master "file, Msgbox will show the address. If it does not, the values will append to the "Master" sheet.

    Same goes to "Station_B" file. If the values not found, it will append to the "Master" sheet.

    Macro to be wrriten in "Station_A" and "Station_B" file only, no macro in "master" file.


    Thank you in advance for helping to solve the problem !!!
    Attached Files Attached Files

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,945

    Re: macro to check if a value exist in a column and add it if it does not

    nishaashokdhar you reported this thread as being unable to download the files. Both FlameRetired and myself were able to download/open them with no problems.
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Registered User
    Join Date
    06-30-2021
    Location
    SG
    MS-Off Ver
    365
    Posts
    2

    Re: macro to check if a value exist in a column and add it if it does not

    Hi,
    I have downloaded the files with no issues.
    Has any expert know how to solve such Macro, Pls helpconfused:

    Thank you.

+ 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] Check if values exist and add 1 in the column at the right
    By okela in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-25-2019, 06:13 AM
  2. [SOLVED] Check if cell value exist in another sheet column, msg box
    By shiva_reshs in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-22-2019, 03:41 AM
  3. [SOLVED] Check if ALL Row Values Exist In Another Column
    By excel-help in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 04-24-2019, 02:11 AM
  4. Macro to check if comment exist.
    By tactical in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-21-2012, 06:55 AM
  5. Macro to copy the tab and check whether that tab already exist
    By raghunaik in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-03-2009, 03:14 AM
  6. Check if Column Exist
    By izet99 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 08-21-2009, 02:43 PM
  7. [SOLVED] Check if a value exist in a column
    By DJ Steffo in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-30-2006, 10:40 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