Question

  • Creator
    Topic
  • #2153330

    Excel Macro Question

    Locked

    by randyw ·

    I need to write a macro in Excel. I have an existing spreadsheet with data. I am importing in to a 2nd sheet a CSV file containing a list of data with basically an ID field and a quantity field. I want to take the ID field, and search to find a match on the original Excel sheet, and when I find it, take the number in the quantity field of the imported data and update the corresponding quantity field in the original sheet. The importaed data is variable, so it will different each time it’s imported in, so I’m not searching for the exact same data each time, if that makes any sense. Is there an easy way to do this? Thanks.

All Answers

  • Author
    Replies
    • #2799195

      Clarifications

      by randyw ·

      In reply to Excel Macro Question

      Clarifications

    • #2799003

      Case of Lookup

      by dlamarche ·

      In reply to Excel Macro Question

      Did you consider using VLookup?

      It will lookup the ID you are seeking in the imported .csv file and return the value in the column you specify.

      • #2799001

        Just be sure to sort both….

        by thumbsup2 ·

        In reply to Case of Lookup

        If you don’t sort both on the same key, your VLookup will quit looking when it reaches a value above/beyond what you’re searching for.

Viewing 1 reply thread