+ Reply to Thread
Results 1 to 2 of 2

macro for finding values in sheet2 and printing it in sheet1

  1. #1
    Registered User
    Join Date
    01-03-2013
    Location
    Saudi Arabia
    MS-Off Ver
    Excel 2007
    Posts
    28

    Question macro for finding values in sheet2 and printing it in sheet1

    i have 2 sheets namely SHEET1 and SHEET2

    Sheet 1 has the following contents
    ------------------------------------------
    A B C... H I
    sdfas asdad TOWEL sdff
    bgfb sfvsv TOWEL 132d
    aes4 322sd BAG sdg3
    q3rwas asdc3 HAT asfas
    q3e1 qwd123 PANTS 1321e
    sdfw wfwq TOWEL q3r23e
    2refc 23cs TOP sgvw4
    ------------------------------------------


    Filter may or maynot be applied in Sheet 1 and 2.
    Column B, C, I (in Sheet 1) have values which are not of concern here.
    Column A (sheet 1)is empty and is to be filled
    Column H(Sheet 1) is of concern.
    There are actually more rows and columns but i have made a sample to look easy.


    Sheet 2 has the following
    --------------------------------
    A B
    TOW TOWEL
    BG BAG
    PNT PANTS
    FGH BRA
    SHO SHOE
    .
    .
    .
    BLT BELTS
    ----------------------------------

    So what i want to do is
    1. copy all matching values of Sheet1 Col H with Sheet2 colB and display the Sheet2 ColA values in Sheet1 ColA
    2. and also i want a Message Box Displaying all the values NOT found in Sheet2.
    3. values not found should be left BLANK in Sheet1.


    I want the output in Sheet1 like:
    ---------------------------------------
    A B C... H I
    TOW sdfas asdad TOWEL sdff
    TOW bgfb sfvsv TOWEL 132d
    BG aes4 322sd BAG sdg3
    q3rwas asdc3 HAT a sfas
    PNT q3e1 qwd123 PANTS 1321e
    TOW sdfw wfwq TOWEL q3r23e
    2refc 23cs TOP sgvw4
    ---------------------------------------


    MsgBox
    --------------------
    |
    items not found: |
    HAT |
    TOP |
    --------------------



    I could manually do this, but the problem is i have alot of files and have to keep doing it.
    So i want to create a macro which could do this.
    Can anyone please help me create the macro as i am just a beginner at this.

    Help appreciated.

    Thanks

  2. #2
    Registered User
    Join Date
    01-03-2013
    Location
    Saudi Arabia
    MS-Off Ver
    Excel 2007
    Posts
    28

    Re: macro for finding values in sheet2 and printing it in sheet1

    im also posting the text file if the view is not clear.
    Attached Files Attached Files

+ 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