+ Reply to Thread
Results 1 to 7 of 7

Searching an entire column for all the values existing in a nother column

  1. #1
    Registered User
    Join Date
    11-10-2007
    Location
    Sweden
    Posts
    32

    Searching an entire column for all the values existing in a nother column

    I have been looking and browsing the web all day now for a macro that would really help me out. But first some background.

    I have 2 worksheets in the same workbook.
    The first workbook (ProductDatabase) is like a database, with the product names in column A. The second worksheet (tmpWeb) is imported from the web though a macro and then put into the second worksheet. Also in this worksheet the product names are in column A.

    What I need to do is that I want to create a macro that does the following thing:

    starts in the second sheet (tmpWeb), in cell A1 and then see if the same value exist in the other worksheet, ProductDatabase, somewhere in the entire column A, not just in the corresponding cell A1. If so, I then want the following value "Registered" to be put in column H in the same row. If the same value does not exist anywhere in column A, then no value needs to be added into column H.

    After the macro have checked if cell A1 in tmpWeb exists somewhere in ProductDatabase-sheet in column A, I want the macro to check if cell A2 exist, and then A3, A4 and so on. Until the whole column A in tmpWeb has been checked, i guess the whole range then. (there will not be any rows between any products since the product name always must exist).

    If someone could point me in the right direction how I can do this, I would be really happy!

  2. #2
    Forum Contributor
    Join Date
    11-17-2006
    Posts
    152
    try this, i think i understood what you wanted, did you want the "registered" in the product database set?

    any way hope this helps, let me know if it need modifying.


    Please Login or Register  to view this content.
    regards,

    Jon

  3. #3
    Registered User
    Join Date
    11-10-2007
    Location
    Sweden
    Posts
    32
    Jonn

    It works Great! And right of the box too, I did not even have to change one single line!

    I would very much like to thank you for the time and effort you put into writing all this, thank you so much.

  4. #4
    Forum Contributor
    Join Date
    11-17-2006
    Posts
    152
    No worries mate, i like problems like this

    If you need a hand with anymore code give us a shout.

    Cheers,

    Jon

  5. #5
    Registered User
    Join Date
    11-10-2007
    Location
    Sweden
    Posts
    32
    What if the counter that counts the number of "Registered" to put into column H also checks if the product allready have been "Registered".

    So that those product with "Registered" in column H do not count when displaying the msgbox. I tried to change the code a bit but not succsessfully.

  6. #6
    Forum Contributor
    Join Date
    11-17-2006
    Posts
    152
    try this

    Please Login or Register  to view this content.
    Jon

  7. #7
    Registered User
    Join Date
    11-10-2007
    Location
    Sweden
    Posts
    32
    That extra code did the trick, now everything is working just as I want it to be.

    Thank you Jonn!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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