I am currently trying to open and save individual sheets in a workbook with the following code:
However, this function would only work for a sheet named EVENTS. I want to use something likeCode: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
Sheets(sFileName) , but this is not legal. Any help, or am I just stuck?




Reply With Quote