+ Reply to Thread
Results 1 to 3 of 3

Compare values in column B of sheet 1 with all the values of Column A in sheet2

  1. #1
    Forum Contributor
    Join Date
    02-20-2009
    Location
    bristol
    MS-Off Ver
    Excel 2003
    Posts
    882

    Compare values in column B of sheet 1 with all the values of Column A in sheet2

    Hi Guys

    I have to do the following steps. I have written the code but its not working properly:

    1. Select the first entry in Sheet (Inventory), column B (Barcode)
    2. Search for a match on Sheet(Barcoded Files) Column A (Wincanton Code)
    3. If there is a match, update the correct row in Sheet(Inventory) Column C (Issue) with the row number of the match from step 2 above & then proceed to step 5 below
    4. If there is no match proceed to step 5
    5. Select the next entry in Sheet (Inventory), column B (Barcode) and go to step 2


    please see the code below. It takes ages to run:

    Please Login or Register  to view this content.
    ANy help would be much appreciated.

    Thanks

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Compare values in column B of sheet 1 with all the values of Column A in sheet2

    Hi,

    Why are you using a macro, and a looping one at that to perform a task which from your description can probably be achieved with standard Excel functionality in a fraction of the time?

    Even if the macro is part of another automated process you can still use standard functions to build the results for you.

    Upload the workbook and manually add a selection of results so that we can see the end goal.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Valued Forum Contributor nigelbloomy's Avatar
    Join Date
    11-06-2013
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    1,011

    Re: Compare values in column B of sheet 1 with all the values of Column A in sheet2

    It looks like you could use a formula like this in C2 of your Inventory sheet and copy it down the column.

    Please Login or Register  to view this content.
    Some people volunteer in soup kitchens or hospitals. I choose to make the world better by trying to help you with Excel. We're all learning.

    <---Click * Add Reputation for all helpful comments. It's like giving a smile.
    Forum Rules: How to mark your post [Solved] and have a happier, Excel enriched life.

+ 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. Replies: 2
    Last Post: 09-27-2012, 01:19 PM
  2. Replies: 2
    Last Post: 09-01-2012, 04:13 PM
  3. How to Compare Column 12 to values in column 6 while deleting dups from column 12
    By Launchnet in forum Excel Programming / VBA / Macros
    Replies: 33
    Last Post: 12-16-2011, 03:21 AM
  4. Macro that will copy values in Column J and paste values to Column B in new sheet
    By Phixtit in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-16-2010, 04:56 PM
  5. Compare values on sheet 1 to values on sheet2
    By Colin in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-02-2006, 02:25 PM

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