Need macro to save as pdf in specific folder with cell value and date.

pider202

New Member
Joined
Apr 16, 2010
Messages
2
Can anyone help me with creating a macro that will save the worksheet as a pdf in a specific folder with the value of a cell and the date. This is what I have so far.

ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:=Range("H10").Value & Format(Date, "mmdd")

This saves it as the correct cell value + the date, but it saves it to my documents. I need it to save to a shared folder on a network drive.

Any help would be greatly appreciated.
THANKS
 

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
Add the conman network path before PDF file name

e.g.

Code:
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:="P:\NetworkFolder\NetworkSubfolder\" & Range("H10").Value & Format(Date, "mmdd")
 
Upvote 0
I borrow this tread :)
I´m trying to write a macro that saves to .pdf accoring tha name in cell F4
this
Code:
Sub Makro1()
'
' Makro1 Makro
'


'
    Range("A2:J23").Select
    ChDir "I:\LC2016\Individuell"
    ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
        "I:\LC2016\Individuell\& Range("F4").Value & ".pdf" ", Quality:=xlQualityStandard, _
        IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:= _
        True
End Sub
gives sybtax-error
Please help mee
/Peter
 
Upvote 0
I found out why :), the code was missing a "
Code:
Sub Makro1()'
' Makro1 Makro
'


'
    Range("A2:J23").Select
    
    ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
        "I:\LC2016\Individuell\[COLOR=#b22222]"[/COLOR] & Range("F4").Value & ".pdf", Quality:=xlQualityStandard, _
        IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:= _
        True
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,591
Messages
6,120,425
Members
448,961
Latest member
nzskater

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