Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
KC KC is offline
external usenet poster
 
Posts: 107
Default Print Button with Criteria

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?
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default 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?


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
print button macro & specific tabs to print Chuck[_3_] Excel Worksheet Functions 2 November 22nd 07 12:21 AM
Print button [email protected] Excel Discussion (Misc queries) 1 August 18th 06 11:40 AM
print button Caveman Excel Discussion (Misc queries) 2 November 18th 05 12:44 PM
print button C A Excel Discussion (Misc queries) 1 June 25th 05 12:24 AM
button to print rob New Users to Excel 2 January 13th 05 09:45 PM


All times are GMT +1. The time now is 11:51 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"