I am attempting to make a thing that will take the data from the current workbook (OVC Process v1.0.3.xlsm), Sheet named "Data" and after clicking button, upload that data into another workbook "OVC Metrics.xlsx", Sheet named "Data" on a Sharepoint site. I can do the copy/past function, but I need help with the overwrite function.
Here's what I got:
If anyone could help me with this I'd be greatful.![]()
Sub Update_All() Dim wkb1 As Workbook Dim sht1 As Worksheet Dim wkb2 As Workbook Dim sht2 As Worksheet LoadFilePath = "..........blah blah....OVC_Metrics.xlsx" Application.ScreenUpdating = False Application.AskToUpdateLinks = False Set wkb1 = ThisWorkbook Set wkb2 = Workbooks.Open(LoadFilePath) Set sht1 = wkb1.Sheets("Data") Set sht2 = wkb2.Sheets("Data") ' Copy Rows sht1.Range("A2:V1500").Copy ' Find Last Row lastrow = sht2.Cells(Rows.Count, "A").End(xlUp).Row ' Paste Rows sht2.Range("A" & lastrow + 1).PasteSpecial xlPasteAll ' Close Database wkb2.Close SaveChanges, Filename:=True MsgBox "Thanks for Uploading your Data! You're the best!" Application.ScreenUpdating = True End Sub
Bookmarks