PDA

View Full Version : [SOLVED] Active Sheet Save As???



erin64
02-02-2005, 01:46 PM
I did do the search, actually twice...:yes . But couldnt find the answer...
I want a command button click to save te sheet in C:Siirrettavat\Verot.xls

What is the exact code and does it still ask if you want to owerwrite an existing file?

Easy question, but new for me..:think:

Thanks

-erin-

mvidas
02-02-2005, 02:16 PM
Hi Erin,

To save just the activesheet, you could use code like:



Application.ScreenUpdating = False
ActiveSheet.Copy
'Application.DisplayAlerts = False
ActiveWorkbook.SaveAs "C:\Siirrettavat\Verot.xls"
'Application.DisplayAlerts = True
ActiveWorkbook.Close
Application.ScreenUpdating = True


What it is doing is copying the activesheet to its own workbook, then saving that. It will prompt you to overwrite an existing file; if you want that prompt gone then un-comment the "Application.DisplayAlerts" lines

Matt

erin64
02-02-2005, 02:48 PM
Thanks for helping me, did just what I wanted:)

mvidas
02-02-2005, 03:01 PM
Glad to hear :)
Just so you know, you can help cleanup this site by marking this thread as Solved (it will also prevent other people from coming into this question to see if you still need help). Go to Thread Tools at the top of the page, and choose Mark Solved.
Let me know if you need any more help!

erin64
02-02-2005, 03:07 PM
:beerchug:

Thanks again.. You are the man in my life...
I'm turning grey over this woorkbook...

Goodnight

-e-