Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Printing Excel to Adobe pdf

Status
Not open for further replies.

swtrader

IS-IT--Management
Dec 23, 2004
182
US
Below is the VBA used on a spreadsheet to print to an Adobe pdf file. The "Ne09" (outtamyleague here) is the desktop non-network default printer I am using. Another worker needs to use this spreadsheet (from the network) and print the spreadsheet to a pdf file based on their different "Ne#". Can the "Adobe PDF on Ne09:" be set dynamically from a cell in the spreadsheet. That cell's value can be set based on who signs into the spreadsheet.


'Print the Report
Application.ActivePrinter = "Adobe PDF on Ne09:"
Range("BD1:BQ1921").Select
ActiveSheet.PageSetup.PrintArea = "$BD$1:$BQ$1921"
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True

swtrader
-- The trouble with doing something right the first time is that no one appreciates how hard it was.
 


Sure, assuming the string is in A1...
Code:
'Print the Report
    Application.ActivePrinter = [A1]
    With ActiveSheet
       .PageSetup.PrintArea = "$BD$1:$BQ$1921"
       .PrintOut Copies:=1, Collate:=True 
    End with
[code]


Skip,
[sub]
[glasses] [b][red]Be Advised![/red] [/b] A chicken, who would drag a wagon across the road for 2 cents, is…
[b]POULTRY in motion to PULLET for a PALTRY amount![/b] [tongue][/sub]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top