Saving file name to cell code not working, any advice ?

JamesStag

New Member
Joined
Jul 25, 2018
Messages
18
Hi i am looking to save quotes, and name them the clients address and date. Any advice on this code? cheers

Sub Save3()

Dim filename As String

Dim Path As String

Dim path1 As String

Dim path2 As String

Path = "C:\Users\James\Documents\Excel Test Folder\Quotes PDFs Test"
path1 = "C:\Users\James\Documents\Excel Test Folder\Invoice PDFs Test"
path2 = "C:\Users\James\Documents\Excel Test Folder\Quotes Invoices Spread Sheets"

filename = Range("C6").Text & ".pdf"

ActiveSheet.SaveAsFixedFormat Type:=xlTypePDF, filename:= _
Path + filename, _
Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas _
:=False, OpenAfterPublish:=False

ActiveSheet.SaveAsFixedFormat Type:=xlTypePDF, filename:= _
path1 + filename, _
Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas _
:=False, OpenAfterPublish:=False

ActiveSheet.SaveAsFixedFormat Type:=xlTypexlsx, filename:= _
path2 + filename, _
Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas _
:=False, OpenAfterPublish:=False

End Sub
 
OK i have gone another direction that is working some what, onli issue so far is the third save is stuck in PDF not xlsm. ANy advice ?

Sub save()

Sheets("Quote").Select
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, _
filename:="C:\Users\James\Documents\Excel Test Folder\Quotes PDFs Test\_" & _
Worksheets("Details").Range("C6").Value & ".pdf", _
OpenAfterPublish:=False

Sheets("Invoice").Select
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, _
filename:="C:\Users\James\Documents\Excel Test Folder\Invoice PDFs Test\_" & _
Worksheets("Details").Range("C6").Value & ".pdf", _
OpenAfterPublish:=False

Sheets("Details").Select
ActiveSheet.ExportAsFixedFormat Type:=xlOpenXMLWorkbookMacroEnabled, _
filename:="C:\Users\James\Documents\Excel Test Folder\Quotes Invoices Spread Sheets\_" & _
Worksheets("Details").Range("C6").Value & ".xlsm", _
OpenAfterPublish:=False




Worksheets("Details").Select
Range("C4").Select
ActiveCell.Value = ActiveCell.Value + 1
End Sub
 
Upvote 0

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.

Forum statistics

Threads
1,223,911
Messages
6,175,327
Members
452,635
Latest member
laura12345

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