Hi guys,
I'm stuck..
I'm trying to copy one sheet into a new workbook and save this as a variable name ansd then close the original workboo kwithout saving..
Here's where I am and it's not working
Any help would be appreciated.
Thanks,
I'm stuck..
I'm trying to copy one sheet into a new workbook and save this as a variable name ansd then close the original workboo kwithout saving..
Here's where I am and it's not working
VBA Code:
Set wb = ThisWorkbook
Sheet16.Copy
wb.Activate
Application.DisplayAlerts = False
ThisWorkbook.Saved = True
wb.Close
filename = accno & ".csv"
DTAddress = CreateObject("WScript.Shell").SpecialFolders("Desktop") & Application.PathSeparator
Application.DisplayAlerts = False
ActiveWorkbook.SaveAs DTAddress & filename, FileFormat:=xlCSV
Application.DisplayAlerts = True
Any help would be appreciated.
Thanks,