+ Reply to Thread
Results 1 to 6 of 6

Copy master wb/ws to new wb/ws to overwrite data only if column a info matches both

  1. #1
    Forum Contributor
    Join Date
    07-23-2019
    Location
    San Antonio, Texas
    MS-Off Ver
    Office 365
    Posts
    141

    Copy master wb/ws to new wb/ws to overwrite data only if column a info matches both

    Hello,

    I have a workbook - "DB Master," with several worksheets, and another workbook - "Dashboard_A", which also has several worksheets.
    I am trying to copy data from specified columns of the "Master" worksheet, from the "DB Master" workbook, to the "DB Billing" worksheet of the "Dashboard_A" workbook.

    Workbooks are not in the same folders, but they are on the same drive. I would like to be able to keep the "Dashboard_A" closed when running the macro.

    I was able to get the copy/paste function to work with the macro below, and also in the attached workbooks, but when I run the macro, it removes all previous data and replaces with the new.

    What I need is for it to look at column A of both worksheets, and if the names from column A matches, it will update the values only from the specified columns,
    but, if a new name is added to the Master ws, it will create that new name into the DB Billing ws - as a new entry.

    I may be running the wrong macro all together, so any help or advice would be greatly appreciated!

    Current Code:

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

  2. #2
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,908

    Re: Copy master wb/ws to new wb/ws to overwrite data only if column a info matches both

    Your Master workbook is protected. What is the password? Do you want to check if any name in column A in the "Master" sheet exists in column A of the "DB Billing" sheet or if any name in column A in the "DB Billing" sheet exists in column A of the "Master" sheet? Also if the names are found, describe in detail which cells you want to copy and into which cells you want to paste.
    You can say "THANK YOU" for help received by clicking the Star symbol at the bottom left of the helper's post.
    Practice makes perfect. I'm very far from perfect so I'm still practising.

  3. #3
    Forum Contributor
    Join Date
    07-23-2019
    Location
    San Antonio, Texas
    MS-Off Ver
    Office 365
    Posts
    141

    Re: Copy master wb/ws to new wb/ws to overwrite data only if column a info matches both

    Sorry - forgot it was protected. Password is Jason.

    I want to check if the name in column A of the DB Billing Sheet already exists and has a match to the Master sheet, then update the numbers from the master to the db billing.
    if the name does not already exist in the db billing, but does exist in the master, i need the name and data to be added to the db billing.
    if there is a name/data in the db billing ws (that is not in the master), I need it to be "left alone" - as is.


    From the Master ws, I need column A to column A of the DB Billing ws
    From the Master ws, I need column D to column B of the DB Billing ws (1 = 3)
    From the Master ws, I need column F to column C of the DB Billing ws (2 = 5)
    From the Master ws, I need column H to column D of the DB Billing ws (3 = 7)
    From the Master ws, I need column R to column E of the DB Billing ws (4 = 17)



    Hope that all made sense .

  4. #4
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,908

    Re: Copy master wb/ws to new wb/ws to overwrite data only if column a info matches both

    Start by deleting the macro you posted from the Dashboard workbook and then save the Dashboard as a regular Excel file so that it has an "xlsx" extension. Close the Dashboard workbook. Place the macro below in the Master workbook and run it from there.
    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    07-23-2019
    Location
    San Antonio, Texas
    MS-Off Ver
    Office 365
    Posts
    141

    Re: Copy master wb/ws to new wb/ws to overwrite data only if column a info matches both

    Hello Mumps1,

    The macro you provided Works Perfect (I have so much to learn)!

    thank you so much for your help and time!!!

    Kindest Regards,
    Paula

  6. #6
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,908

    Re: Copy master wb/ws to new wb/ws to overwrite data only if column a info matches both

    You are very welcome.

+ 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. Macro to overwrite master for changes made in master and read only
    By mk3supra in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-22-2013, 07:48 AM
  2. Split data from Master Sheet to existing worksheets and overwrite data
    By vmwest in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 03-21-2013, 05:36 PM
  3. Replies: 2
    Last Post: 01-12-2013, 12:22 PM
  4. [SOLVED] IF name in column A matches then copy data in other field
    By Blue Fishey in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 08-16-2012, 04:38 PM
  5. Replies: 2
    Last Post: 07-29-2010, 09:57 AM
  6. Sub to copy a target sheet from slaves from and paste/overwrite into master
    By Max in forum Excel Programming / VBA / Macros
    Replies: 19
    Last Post: 06-13-2005, 10:05 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