![]() |
|
#1
|
|||
|
|||
![]() in line 2 of your code, instead of: ActiveSheet.ExportAsFixedFormat change to : Sheets("Sheet1").ExportAsFixedFormat Rename Sheet1 to match your sheet name.. copy macro as many times as sheets number in each copy rename sheet to convert, and assign the macros to appropriate buttons (butons created via Developer-controls-insert-buton...) or make your macro ask to enter sheet name to convert... Code:
Sub mySheetNameSelection() Dim mySheetName As String On Error GoTo error_NoSheet mySheetName = InputBox("Enter Sheet Name") Sheets(mySheetName).ExportAsFixedFormat Type:=xlTypePDF, Filename:= _ sFileName, Quality _ :=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas:=False, _ OpenAfterPublish:=True On Error GoTo 0 Exit Sub error_NoSheet: If Err.Number = 9 Then MsgBox "No such sheet name exists" Exit Sub Else MsgBox Err.Number & vbCrLf & Err.Description End If End Sub |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
rvessio | Word VBA | 4 | 07-25-2016 12:37 PM |
Reading Values from another sheet | Raabi | Excel | 2 | 05-20-2011 02:14 AM |
PowerPoint Crashes every time I try to save/save as | Crimson_Ninja | PowerPoint | 0 | 05-04-2011 01:54 PM |
![]() |
Salim Khan | Excel | 1 | 08-30-2010 09:11 AM |
copy cell from sheet 2 to sheet 3 macro | slipperyjim | Excel Programming | 1 | 02-18-2010 01:31 AM |