Print Button with Criteria
You could do this without a macro.
Just create 3 Custom Views with different print settings.
ViewCustom Views
Or a macro for your button.
Sub print_cases()
With ActiveSheet
Select Case Range("E6")
Case "SMB"
.PageSetup.PrintArea = "$A$1:$P$39"
.PrintOut
Case "KRT"
.PageSetup.PrintArea = "$A$1:$F$39"
.PrintOut
Case "BRS"
.PageSetup.PrintArea = "$A$1:$T$39"
.PrintOut
End Select
End With
End Sub
Gord Dibben MS Excel MVP
On Wed, 27 Feb 2008 12:58:00 -0800, KC wrote:
I have a tab in my workbook that I want to print with a print button.
However, it needs to print depending on certain criteria. Such as, if Cell
E6 = "SMB" then print A1:P39, if Cell E6 = "KRT" then print A1:R39, if Cell
E6 = "BRS" then print A1:T39. Is it possible to do this?
|