Creating PDF with vba code

asyamonique

Well-known Member
Joined
Jan 29, 2008
Messages
1,280
Office Version
  1. 2013
Platform
  1. Windows
Good Day,
How can I alter below code instead of ActiveSheet.Name , I want spesific cell text like below ;
Sheets("info").Range("c35")

Thanks




VBA Code:
Dim wsA     As Worksheet
Dim strFile, myfile As String
On Error Resume Next
wsA.Activate
    strFile = "\\172.16.23.181\lg folder\ROSTERS\"
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
strFile & " " & [I][COLOR=rgb(184, 49, 47)][B]ActiveSheet.Name[/B][/COLOR][/I] & " " & Format(Date, "mmmm"), _
Quality:=xlQualityStandard, IncludeDocProperties:=True, _
IgnorePrintAreas:=False, OpenAfterPublish:=True
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
maybe like this
change this
VBA Code:
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
to this
VBA Code:
Sheets("info").ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
and this
VBA Code:
strFile & " " & [I][COLOR=rgb(184, 49, 47)][B]ActiveSheet.Name[/B][/COLOR][/I] & " " & Format(Date, "mmmm"), _
to
VBA Code:
strFile & " " & Sheets("info").Name& " " & Sheets("info").Range("c35")  & Format(Date, "mmmm"), _
 
Upvote 0
Solution

Forum statistics

Threads
1,215,219
Messages
6,123,688
Members
449,117
Latest member
Aaagu

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