Hi everyone,
I wonder if someone could please guide me, I have a document which automatically saves certain columns to another Excel document before closing, however I would like that to save to my file in One Drive. I'm unable to do so - please could you help.
This is the VBA code I'm currently using :
I wonder if someone could please guide me, I have a document which automatically saves certain columns to another Excel document before closing, however I would like that to save to my file in One Drive. I'm unable to do so - please could you help.
This is the VBA code I'm currently using :
VBA Code:
Dim r As Long, lr As Long, Archieve As Workbook
Application.ScreenUpdating = False
r = 4
lr = Cells(Rows.Count, 1).End(xlUp).Row
Range(Cells(r, 23), Cells(r, 28)).Copy
Set archive = Workbooks.Open("C:\Desktop\Test.xlsx")
Worksheets("Test").Select
Range("A1048576").Select
Selection.End(xlUp).Select
ActiveCell.Offset(1, 0).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks:=False, Transpose:=False
archive.Close SaveChanges:=True
Application.ScreenUpdating = True