Automatically Saving created FILE

M

macronewbie

Hi,

Just would like to ask help on how to automatically save a created file just
by the use of command button.

I have below macro code:
Sub CSVFILE()
Dim sh As Worksheet

ActiveSheet.Copy
Set sh = ActiveSheet

On Error Resume Next
sh.Buttons.Delete
sh.Rows("1:2").Delete
On Error GoTo 0
End Sub

I want to "save as" the generated new workbook automatically when I click
the command button to create the new wokbook. Is this possible? THANKS!
 
P

Project Mangler

Morning macronewbie


macronewbie said:
I want to "save as" the generated new workbook automatically when I click
the command button to create the new wokbook. Is this possible? THANKS!

Not sure if you want to be able to choose a path and filename. This is a
simpler version:

ActiveSheet.SaveAs Filename:="c:\Temp\CSVfile.xls"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top