F
Forum Freak
Hi
I open a file with code using GetOpenFileName then copy a sheet to an
already open file.
I have tried altering the code to close the file after the sheet has been
copied but have had no success.
Could someone tell me how to do it?
Many Thanks
Kenny
XP Pro
Office 2003
The code I am currently using is below
Sub OpenAFile()
' thanks MrExcel.com
Dim vFilename As Variant
vFilename = Application.GetOpenFilename("Microsoft Excel
Workbooks,*.xls")
If vFilename = False Then Exit Sub 'User pressed Cancel
Workbooks.Open vFilename
Sheets("Data").Select
Sheets("Data").Copy Before:=Workbooks( _
"Copy of Defects Audit V4.01getopenfilename.xls").Sheets(1)
MyAudit
Sheets("Data").Delete
Sheets("Report").Select
End Sub
I open a file with code using GetOpenFileName then copy a sheet to an
already open file.
I have tried altering the code to close the file after the sheet has been
copied but have had no success.
Could someone tell me how to do it?
Many Thanks
Kenny
XP Pro
Office 2003
The code I am currently using is below
Sub OpenAFile()
' thanks MrExcel.com
Dim vFilename As Variant
vFilename = Application.GetOpenFilename("Microsoft Excel
Workbooks,*.xls")
If vFilename = False Then Exit Sub 'User pressed Cancel
Workbooks.Open vFilename
Sheets("Data").Select
Sheets("Data").Copy Before:=Workbooks( _
"Copy of Defects Audit V4.01getopenfilename.xls").Sheets(1)
MyAudit
Sheets("Data").Delete
Sheets("Report").Select
End Sub