ColoKevMan
New Member
- Joined
- Jun 26, 2015
- Messages
- 9
- Office Version
- 365
- Platform
- Windows
The below code runs flawlessly on my laptop. When a co-worker, on same network with same access/permissions, runs the macro, it gets the Runtime Error 9 on the Master.Sheets("Buyers IRs").Select row. It's like it can't find the worksheet, but it does easily on my machine. Thoughts?
VBA Code:
Sub CopyBuyersIRsc()
' Copy Buyers IR tab from Master
Application.ScreenUpdating = False
Dim Currentwb As Workbook
Dim Master As Workbook
Set Currentwb = ThisWorkbook
Set Master = Workbooks.Open("some sharepoint link/workbook name")
Dim lRowEnd As Long
'
Master.Sheets("Buyer IRs").Select
Sheets("Buyer IRs").Copy After:=Currentwb.Sheets("Sherry C")
lRowEnd = Range("A60000").End(xlUp).Row
Range("$K$2:$K$" & [lRowEnd]).Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Master.Close savechanges:=True
Sheets("Sherry C").Activate
Range("G9").Select
Application.ScreenUpdating = True
End Sub
Last edited by a moderator: