VBA to save in a folder specified in a cell as well as saving document as a name specified in cell

tcorcoran15

New Member
Joined
Feb 16, 2017
Messages
22
Hi All,

Appreciate any help with this.

I want to save a file using VBA into a specified folder on the server.

Most of the save location will not change so I would like to have the first part up until the final folder hard coded into the vba.

However, I would like the final folder name to be specified in Cell B18, then I would like the save name of the file to be cells B20, B16 and B18 combined with spaces in between.

For Example

"X:\Tom\Documents" to be hardcoded and then the following folder & save name from that be specified in cells.

Is this possible?

Please let me know if you require more information.
 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
dim stree as string
dim sname as string
dim sfolder as string

stree = "X\Tom\Documents"
sname = Cells("a1").Value
sfolder = Cells("B18").Value

stree = stree & sfolder & sname

=activeworkbook.saveas Filename:= sname

hth,

Jon
 
Upvote 0

Forum statistics

Threads
1,223,230
Messages
6,170,883
Members
452,364
Latest member
springate

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