Hi Everyone,
I managed to write a macro to do the copy paste from one workbook to another. But somehow, its giving the stupid red error ! "Subscript out of range"
I sware I checked the location 12314 times.
And the file is already open, since the macro button is on that file in the first place.
Any has any idea, what is the reason ?
Thanks a lot
Orhan
Sub copy_paste()
Dim x As Workbook
Dim y As Workbook
Dim ws1 As Worksheet
Application.ScreenUpdating = False
Set x = Workbooks.Open("\\ant\dept-eu\PRG10\HR\prg10-eu-hr-services\T2-ZA\2. Extended Onboarding\3. Tracker\HRS TEST.xlsx")
Set ws1 = x.Sheets("Manual Data Shared File")
ws1.Select
Rows("1:9999").Select
Selection.Delete Shift:=xlUp
Windows("\\ant\dept-eu\PRG10\HR\prg10-eu-hr-services\T2-ZA\2. Extended Onboarding\3. Tracker\a.XLSM").Activate
Worksheets("Data").Activate
Range("A1:CX2000").Select
Application.CutCopyMode = False
Selection.Copy
Windows("\\ant\dept-eu\PRG10\HR\prg10-eu-hr-services\T2-ZA\2. Extended Onboarding\3. Tracker\HRS TEST.xlsx").Activate
Sheets("Manual Data Shared File").Select
Range("A1:CX2000").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
End Sub
Bookmarks