![]() |
|
#1
|
||||
|
||||
![]()
Hi Albert,
To change the filename, you'd change 'ActiveSheet.Name' to point to the cell you want to get the name from (eg: 'ActiveSheet.Range("A1").Value'). Thus: Code:
sFileName = InputBox("Save PDF to desktop as:", "Sheet '" & _ ActiveSheet.Name & "' to PDF...", ActiveSheet.Name) Code:
sFileName = InputBox("Save PDF to desktop as:", _ ActiveSheet.Range("A1").Value & "' to PDF...", ActiveSheet.Name) Similarly, to change the folder, you could replace the line: Code:
sFolder = Environ("USERPROFILE") & "c:\Invoices\" Code:
GetFolder: sFolder = Environ("USERPROFILE") & "c:\Invoices\" sFolder = InputBox("Save PDF folder:", sFolder, "Save Folder") If Dir(sFolder, vbDirectory) = "" Then MsgBox "Not a valid folder", vbCritical GoTo GetFolder End If Code:
ActiveSheet.PrintOut Code:
ActiveSheet.PrintOut Copies:=3 Code:
ActiveSheet.PrintOut Copies:=InputBox("How many copies to print?", "Print Count", 3)
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
![]() |
Thread Tools | |
Display Modes | |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
anna.a.julin | Word | 1 | 03-01-2012 08:05 PM |
![]() |
siouxnami | Outlook | 4 | 01-26-2012 12:24 PM |
Change style of 'open file' window? | markg2 | Word | 0 | 07-08-2011 11:15 AM |
PowerPoint 2003 - Change default location for Insert Picture | Fee | PowerPoint | 0 | 05-12-2011 02:15 AM |
[PowerPoint 2010] Change font for all slides in an exist *.PPTX file | LongTTH | PowerPoint | 0 | 12-15-2010 02:07 AM |