Hi there,
I was wondering if there was any way to reference a sheet with a variable name instead of needing to know the exact name of the sheet?
I am trying to open an individual sheet into my workbook with the code:
Dim sFileName As String
'Show the open dialog and pass the selected _
file name To the String variable "sFileName"
sFileName = Application.GetOpenFilename
'They have cancelled.
If sFileName = "False" Then Exit Sub
Workbooks.Open fileName:=sFileName
Sheets("EVENTS").Copy After:=Workbooks("NLeapGIS10.xls").Sheets(ThisWorkbook.Sheets.Count)
Workbooks("EVENTS.xls").Close
That works fine, if the sheet the person is trying to open is called "EVENTS". However I would like to implement something like
Sheets(sFileName)
to open the name of the sheet the same as the file name.
Bookmarks