Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I found the following macro which prints all selected sheets in an Excel workbook into multiple PDFs and names them the Excel Worksheet name. The first test I did it worked perfectly and saved the PDFs in the same folder that the Excel workbook was in, which was a folder on my desktop. I then put the macro in a personal.xls in C:\ProgramFiles\MicrosoftOffice\OFFICE12\XLStart and tried a different Excel workbook in a different location. The macro was viewable and allowed me to run it, however, it doesn't appear to have saved the PDFs. Can someone tell me what I need to change in my code?
Sub Macro1() Dim N As Long Dim fileString As String Dim cellValue As String With ActiveWindow.SelectedSheets For N = 1 To .Count Sheets(.Item(N).Name).Select cellValue = Trim(Sheets(.Item(N).Name).Range("A1").Value) fileString = .Item(N).Name & cellValue & ".pdf" Sheets(.Item(N).Name).ExportAsFixedFormat Type:=xlTypePDF, Filename:=fileString Next N End With End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
MACRO TO COUNT ALL OPEN WORKBOOKS and print | Excel Programming | |||
Open many workbooks in Excel & print one page | Excel Discussion (Misc queries) | |||
I cannot seem to print certain workbooks from Excel 2003 | Excel Discussion (Misc queries) | |||
can't print what i want in excel shared workbooks | Excel Programming | |||
Why does macro speed slow after Excel Print or Print Preview? | Excel Programming |