Hello,
I have some code here that isn't working and I'm not sure why... I'm trying to copy a worksheet from an outside workbook (the path and filename are located in B2 and B3 of the "Info" tab. I keep getting an "Compile error: Expected: end of statement" message when it gets to the ":=" in the Set CopyFromWbk line.
Dim fPath As String
Dim fName As String
Dim CashFile As String
fPath = Sheets("Info").Range("B2").Value
fName = Sheets("Info").Range("B3").Value
CashFile = fPath & "\" & fName
Dim CopyFromBook As String
Dim CopyToWbk As Workbook
Dim ShToCopy As Worksheet
Set CopyFromWbk = Workbooks.Filename:=CashFile
Set ShToCopy = CopyFromWbk.Worksheets("IAG")
Set CopyToWbk = ActiveWorkbook
ShToCopy.Copy After:=CopyToWbk.Sheets(CopyToWbk.Sheets.Count)
If someone could help, that'd be great.
Thanks!
Bookmarks