Good morning,
I recorded a macro that selects and exports 3 tabs out of a document, but I then want go back to the original document and deselect the original three tabs (to prevent someone from accidentally typing info into one of the tabs and it mirroring it in the other two tabs as well). Anyway, the macro I have works great unless someone renames the original file name. I know there has to be a way around this, but I am too new to vba and literally learning as I go. I suspect the problem is in the second to last line that starts with "Windows."
Thank you for your help!
D
Code
Sub exportchklst()
'
' exportchklst Macro
'
'
Sheets(Array("RBS CHECKLIST", "INVOICE ERRORS", "LATE INVOICES")).Select
Sheets("RBS CHECKLIST").Activate
Sheets(Array("RBS CHECKLIST", "INVOICE ERRORS", "LATE INVOICES")).Copy
ActiveSheet.Unprotect "password"
Cells.Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
ActiveSheet.DrawingObjects.Delete
Sheets("LATE INVOICES").Select
ActiveSheet.Unprotect "password"
Cells.Select
Range("C1").Activate
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("C1").Select
Sheets("RBS CHECKLIST").Select
Range("A1").Select
Windows("RBS Audit Checklist.xlsm").Activate
Sheets("RBS CHECKLIST").Select
End Sub
Display More