vba save as

r_harri1972

New Member
Joined
Sep 23, 2014
Messages
37
i have a worksheet that when i hit the save and print button i want it to be saved as cell H12's value.
H12's value will be the customers name. Sometimes its (1) name or sometimes it is (2) names.
This sheet is a Bill of Lading for shipping. I have a BOL folder in the S: directory which is on the network. Within the BOL folder is a folder for each customer.
For Example: H12 = Eastern Machine & MFG. The folder for them is named Eastern Machine.
i need the save as to save in the eastern machine folder on the s: directory. I would also like for it to save sheet 3 only if possible.

For me: do i need the folder to be named exactly the same as H12's value?

Thanks!!!!!
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
Here is my code...
can anyone see a problem as to why it won't work?

Private Sub PRINT_SAVEButton18_Click()


With ActiveSheet
.Copy
ActiveWorkbook.SaveAs Filename:="S:\BOL's\" & .Range("H12").Value & "\" & .Range("H12").Value & .Range("F10").Text & ".xlsx", FileFormat:=51
ActiveWorkbook.Close
End With
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,596
Messages
6,120,438
Members
448,966
Latest member
DannyC96

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