Macro - Save in specific location as cell name

I heart Excel

Board Regular
Joined
Feb 28, 2011
Messages
66
Hello,

I have a form that I am trying to save to a specific location and name it as a certain cell loaction. I have had a look around and have found the below, which apparently works perfectly, but no luck!!

I must be doing something very wrong as it keeps bugging and highlighting the section in blue below.

Please see the code I have in place at the moment -

Sub SaveAs1()
'
' SaveAs1 Macro
'

'
Sheets(Array("Sickness Form")).Select
Sheets("Sickness Form").Activate

ActiveSheet.ExportAsFixedFormat Type:=xlTypexlsm, Filename:= _
"S:\aliclock\PAULINE SICKNESS TEST\" & Range("B11").Value, Quality:=xlQualityStandard, IncludeDocProperties:=True, _
IgnorePrintAreas:=False, OpenAfterPublish:=True

End Sub

It needs to be a macro because they click on a Save button on the form, and away it 'should' go!!

Thank you soo much for your help in advance, have been stuck on this for about a week now, but wanted to resolve it, unfortunately no luck :(



 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
What's in "B11"?

If that cell doesn't have the .xlsm on the end of the filename you may have to add it with your code.

Code:
"S:\aliclock\PAULINE SICKNESS TEST\" & Range("B11").Value [COLOR=Red]& ".xlsm"[/COLOR]
Gary
 
Upvote 0

Forum statistics

Threads
1,224,603
Messages
6,179,849
Members
452,948
Latest member
UsmanAli786

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