Consulting

Results 1 to 2 of 2

Thread: Comparing 2 sheets

  1. #1
    VBAX Regular
    Joined
    Nov 2007
    Posts
    11
    Location

    Comparing 2 sheets

    Hi Guys,
    I have two spreadsheets. Sheet1 contains a part code in column D. Sheet2 contains the partcodes in column A and the value of the part in column B. I need to update sheet1 with the values regulary. So far i have been using multiple if and for loops instead of referencing the data in sheet2.
    eg

    For Each rCell In Range("D1300")
    If UCase(rCell) = "167856" Then
    rCell.Offset(0, 1) = "27"
    End If
    Next rCell

    where 167856 is a partcode and 27 is the value

    However the amount of partcodes have now tripled and i need a macro to do this for me automatically as sheet2 will be expanding in the future

  2. #2
    Have you tried VLOOKUP function?

    Jimmy
    -------------------------------------------------
    The more details you give, the easier it is to understand your question. Don't save the effort, tell us twice rather than not at all. The amount of info you give strongly influences the quality of answer, and also how fast you get it.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •