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

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
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,216,773
Messages
6,132,633
Members
449,740
Latest member
tinkdrummer

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