VBA Save Sheet

Noz2k

Well-known Member
Joined
Mar 15, 2011
Messages
693
So I have a userform which sends information to a sheet and since I can't figure out how to send the sheet via email directly, I was wondering how to instead automatically save the sheet to the users computer as a new workbook.

Any idea?

Thanks
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
Try like this

Code:
ActiveSheet.Copy
With ActiveWorkbook
    .SaveAs Filename:="C:\test.xls"
    .Close
End With
 
Upvote 0
Didn't seem to work. I changed the the directory and it ran fine without error, but it didn't seem to save the file?
 
Upvote 0
This worked for me:

Code:
Sub a()
ActiveSheet.Copy
With ActiveWorkbook
    .SaveAs Filename:="C:\test.xls"
    .Close
End With
End Sub
 
Upvote 0
Ok, will give this a try tomorrow morning as I have to catch a bus. But thanks very much for your help.
 
Upvote 0

Forum statistics

Threads
1,224,527
Messages
6,179,334
Members
452,907
Latest member
Roland Deschain

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top