Rudolph has attended:
Excel VBA Intro Intermediate course
Anthony as discussed??
How can the results of a query be created in a new file into a completely different folder, after running the macro for reports?
RE: Anthony as discussed??
Hi Rudolph, thanks for the query. Here's the code you need. Make sure the mynewfilename variable is set your desktop (it's set to mine in the example below). The code copies strName to a new file, then saves that file to the desktop.
***
Dim mynewfilename As String
mynewfilename = "C:\Documents and Settings\User10\Desktop\" & strName & ".xls"
Sheets(strName).Select
Sheets(strName).Copy
ActiveWorkbook.SaveAs Filename:=mynewfilename
ActiveWorkbook.Close
***
Hope this is useful!
Anthony