Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Conditional Printing of worksheet


Hello...
I have 2 worksheets that I need to print out based on a cell value in a
third worksheet written as a macro. Example of sheets named: Sheet1,
Sheet2, Sheet3.
Sheet1 contains the control variable in Cell A55. If a value of 1 is in
cell A55, then I wish to print only Sheet1 when the macro is run. If a
value of 2 is in this cell, then I wish to print both Sheet1 and Sheet2
when the macro is run. Simple? Maybe for the VB'ers. Any idea??

Thanx as always. Thor.


--
Thor
------------------------------------------------------------------------
Thor's Profile: http://www.excelforum.com/member.php...fo&userid=1049
View this thread: http://www.excelforum.com/showthread...hreadid=500474

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Conditional Printing of worksheet

Hi Thor,

Try something like:

'=============
Public Sub Tester001()

Dim rng As Range

Set rng = ActiveWorkbook.Sheets("Sheet1").Range("A55")

If rng.Value = 1 Then
Sheets("Sheet1").PrintOut
ElseIf rng.Value = 2 Then
Sheets(Array("Sheet1", "Sheet2")).PrintOut
End If
End Sub
'<<=============


---
Regards,
Norman


"Thor" wrote in message
...

Hello...
I have 2 worksheets that I need to print out based on a cell value in a
third worksheet written as a macro. Example of sheets named: Sheet1,
Sheet2, Sheet3.
Sheet1 contains the control variable in Cell A55. If a value of 1 is in
cell A55, then I wish to print only Sheet1 when the macro is run. If a
value of 2 is in this cell, then I wish to print both Sheet1 and Sheet2
when the macro is run. Simple? Maybe for the VB'ers. Any idea??

Thanx as always. Thor.


--
Thor
------------------------------------------------------------------------
Thor's Profile:
http://www.excelforum.com/member.php...fo&userid=1049
View this thread: http://www.excelforum.com/showthread...hreadid=500474



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
conditional printing Conditional printing Excel Discussion (Misc queries) 4 September 15th 08 01:51 PM
Conditional Printing James[_4_] Excel Discussion (Misc queries) 1 July 24th 07 10:45 PM
Conditional Printing Josh Whitney Excel Programming 5 June 12th 04 12:26 AM
conditional printing skitek Excel Programming 1 June 9th 04 03:04 PM
conditional printing raymondsum[_9_] Excel Programming 4 December 3rd 03 02:24 AM


All times are GMT +1. The time now is 08:25 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"