Quantcast
Channel: Excel Help Forum - Excel Programming / VBA / Macros
Viewing all articles
Browse latest Browse all 50199

How to accomplish copying task

$
0
0
Background of Project:
New to VBA, just created an excel file that has a form to input data about issues encountered with 6 comboboxes and a date box, which all goes to 6 respective columns on the actual data sheet. This file labeled "analyst1" will be used by 1 of 3 people inputting data from their areas. Once they are done inputting the data, the data needs to be copied to the master file labeled "Master". The master file will simply contain the info that all three of the analysts input into their own files.

I have all of it coded, however I currently have the copy and paste set to just copy the columns and paste into the master from one of the analyst files. This works, for one of them, however when 3 people are inputting constantly I cannot just be copying the entire column which will just overwrite the other analysts data entries. So i need each analyst page to take the last used data from when it was last saved, and copy it to the last row that is available in the master file.

I would really appreciate help with this, as this has taken quite sometime for someone who doesn't know VBA at all to get here, and I would like to see this project complete. Any help is appreciated. Thanks.

Here is my current copy and paste code, bound to a "Update master file button" on my data sheet.

Code:

Sub CopyData()
'Copy & Paste Data
    Workbooks.Open Filename:="H:\VBA Excel Project\Personal VBA\Master.xlsm"
    Windows("Master.xlsm").Activate
    Workbooks("Analyst1.xlsm").Worksheets("Data Entry").Range("A:G").Copy _
        Workbooks("Master.xlsm").Worksheets("Sheet1").Range("A:G")
    ActiveWorkbook.Save
    ActiveWorkbook.Close
    Windows("Analyst1.xlsm").Activate
End Sub


Viewing all articles
Browse latest Browse all 50199

Trending Articles