+ Reply to Thread
Results 1 to 5 of 5

Find Match and Update existing otherwise Add to list

  1. #1
    Registered User
    Join Date
    05-07-2013
    Location
    USA
    MS-Off Ver
    Excel 2013
    Posts
    55

    Find Match and Update existing otherwise Add to list

    Hello,

    On the attached workbook I have a macro that places an Index/Match formula in the first tab (Charges) to search for any matches on the second tab (Updates). If it finds a match, then it will update the ChargeAmount on the Charges tab and if it does not find any matches on the Updates, then any non matches will be added to the Charges tab.

    The Macro I have works; however, only with small updates. When I run the macro with all of the data (Charges has 22k rows) and Updates (630 rows), my processor resources skyrocket and brings pc to a standstill.

    I am sure there is a better and more efficient way to do this, but are not sure how.

    Any help would be greatly appreciated

    Attached is the workbook. On the Updates tab, I have highlighted what the update is which will replace the exact match on the charge tab with the new ChargeAmount.

    Macro

    Please Login or Register  to view this content.
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor
    Join Date
    12-22-2015
    Location
    HK
    MS-Off Ver
    2010
    Posts
    532

    Re: Find Match and Update existing otherwise Add to list

    Try this:
    Please Login or Register  to view this content.
    hth
    ikboy

  3. #3
    Registered User
    Join Date
    05-07-2013
    Location
    USA
    MS-Off Ver
    Excel 2013
    Posts
    55

    Re: Find Match and Update existing otherwise Add to list

    @ikboy,

    I tried the code that you provided, but doesn't appear to be pulling correctly.

    Example: on row 7 for Item code C9248 the new charge amount, according to the Updates tab should be 800, but in column F on Charges is showing 751.32 (appears to be multiplying the original charge x 2).

    What needs to happen is if the item on Charges (i'll get more specific, the ItemCode and Description) match the ItemCode and Description on Updates, then the Charge Amount should reflect the chargeamount listed on the updates tab

    So on Row 7 (Charges)
    C9248 | Clevidipine 0.5mg/mL 100mL SDV - 50042

    This line matches on (Updates)
    C9248 | Clevidipine 0.5mg/mL 100mL SDV - 50042

    The ChargeAmount on Charges, should now change from 718.98 to 800.00

    Thanks

  4. #4
    Valued Forum Contributor
    Join Date
    12-22-2015
    Location
    HK
    MS-Off Ver
    2010
    Posts
    532

    Re: Find Match and Update existing otherwise Add to list

    amended:
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    05-07-2013
    Location
    USA
    MS-Off Ver
    Excel 2013
    Posts
    55

    Re: Find Match and Update existing otherwise Add to list

    Thank you so much ikboy, this worked great. Thank you again

+ 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. update existing code to copy and KEEP existing data
    By scott micklo in forum Excel Programming / VBA / Macros
    Replies: 20
    Last Post: 01-26-2016, 05:41 PM
  2. [SOLVED] VBA to find a numeric match on another sheet then add a value to an existing value
    By Jim885 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-03-2015, 09:19 PM
  3. Update existing macro that splits a list into worksheets to split into templates instead
    By Graeme-Black in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-18-2014, 04:19 PM
  4. Need to find status update in a long list.
    By Meshack in forum Excel General
    Replies: 4
    Last Post: 10-25-2013, 11:42 AM
  5. Search/List Box (Userform) cannot find existing Date value in the database
    By archerrc in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-22-2013, 04:57 PM
  6. Automatically update existing data using a Update command button
    By 9999335 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-23-2012, 09:46 PM
  7. Update an existing SharePoint list within Excel using VBA
    By Snoopy2003 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-31-2011, 07:20 PM

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