Save to specified drive, folder

Markkens

Board Regular
Joined
Mar 4, 2003
Messages
197
I'm using a cell contents to generate a save-as filename, but am stuck on getting a drive & folder destination going for this...

Please help!
Thanks!

Z:\TLA\

Sub Save_TLA()
ActiveWorkbook.SaveAs Filename:= _
Worksheets("ID and cust info").Range("b42").Text & ".xls", FileFormat _
:=xlNormal, Password:="", WriteResPassword:="", ReadOnlyRecommended:= _
False, CreateBackup:=False
End Sub
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.

Norie

Well-known Member
Joined
Apr 28, 2004
Messages
76,357
Office Version
  1. 365
Platform
  1. Windows
So what's in the cell and what/where do you want to save the file as?
 

chicagodiceman

Active Member
Joined
Mar 13, 2004
Messages
371
You probably need to specify the directory to store:

Code:
Sub Save_TLA()
ChDir "Z:\TLA"
ActiveWorkbook.SaveAs Filename:= _ 
Worksheets("ID and cust info").Range("b42").Text & ".xls", FileFormat _ 
:=xlNormal, Password:="", WriteResPassword:="", ReadOnlyRecommended:= _ 
False, CreateBackup:=False 
End Sub
 

Markkens

Board Regular
Joined
Mar 4, 2003
Messages
197
Got it. I just added the drive and path as part of the cell contents to read as a filename, giving the save a full path and filename.

Thanks!
 

Forum statistics

Threads
1,181,658
Messages
5,931,269
Members
436,785
Latest member
KingGideon

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
Top