EasterGreen
Board Regular
- Joined
- Sep 7, 2009
- Messages
- 50
I have borrowed VBA code from various posts here to run a batch print job to pdf using data from a drop down list.
I now want to print to pdf sheets 2-4 (which are driven by the input to A8) instead of sheet 1 and cannot get it to work.
The drop down is in cell A8 on sheet 1 and I have assigned a macro button on sheet 1.
How do I make it print sheets 2,3,4 instead of sheet 1?
Thanks
Sub Print_All_Managers()
Dim inputRange As Range
Dim i As Range
Set inputRange = Evaluate(Range("A8").Validation.Formula1)
For Each i In inputRange
Range("A8").Value = i.Value
Activate.ExportAsFixedFormat _
Type:=xlTypePDF, _
Filename:="C:\Users\xxx\" & i.Value, _
Quality:=xlQualityStandard, _
IncludeDocProperties:=True, _
IgnorePrintAreas:=False, _
OpenAfterPublish:=False
Next i
End Sub
I now want to print to pdf sheets 2-4 (which are driven by the input to A8) instead of sheet 1 and cannot get it to work.
The drop down is in cell A8 on sheet 1 and I have assigned a macro button on sheet 1.
How do I make it print sheets 2,3,4 instead of sheet 1?
Thanks
Sub Print_All_Managers()
Dim inputRange As Range
Dim i As Range
Set inputRange = Evaluate(Range("A8").Validation.Formula1)
For Each i In inputRange
Range("A8").Value = i.Value
Activate.ExportAsFixedFormat _
Type:=xlTypePDF, _
Filename:="C:\Users\xxx\" & i.Value, _
Quality:=xlQualityStandard, _
IncludeDocProperties:=True, _
IgnorePrintAreas:=False, _
OpenAfterPublish:=False
Next i
End Sub