Hi,
I am trying to copy a sheet from one workbook to another workbook. When I debug it is opening both the workbooks and the active one is the old workbook. Please take a look and let me know where I am doing wrong. Thanks!
here is my code:
Sub CopyInfoSheet()
Const Procname = "CopyInfoSheet"
Dim StrCurrentRpt As String
Dim strInfoPath As String
Dim strInfofile As String
Dim wb As Workbook
'Get Current Report Name
StrCurrentRpt = wb.Name
'Open file with Lookup tables and import the 1st needed table to the current report
strInfoPath = "\\Reporting\ValueChange\ValueChange.xlsx"
Workbooks.Open (strInfoPath)
strInfofile = ActiveWorkbook.Name
Workbooks(StrCurrentRpt).Sheets("Review").Copy After:=Workbooks(strInfofile).Sheets("Info").Range("InfoRange") 'This is where I am getting error
Workbooks(strInfofile).Close SaveChanges:=False
End Sub
Bookmarks