LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Print Code


Randy;163997 Wrote:
Greetings...

I have a little code I am needing some assistance with. The code is
suppose
to print out certain sheets based on wether a particular cell on
another
sheet is empty or not. If the cell is empty the sheet should not
print...if
cell is not empty, the sheet should print.

Here is what I have....any assistance will be greatly appreciated!
.................................................. ................................................
Private Sub Print_All_Click()
Sheets("Commission Pool").PrintOut Copies:=1, Collate:=True
If Not IsEmpty("D20") Then
Sheets("Sr-Area Manager").PrintOut Copies:=1, Collate:=True
Else
Sheets("Sr-Area Manager").PrintOut Copies:=1, Collate:=False
End If
End Sub
.................................................. ................................................

Thanks again and have a wonderful and safe New Year celebration!
--
Randy Street
Rancho Cucamonga, CA


Hello Randy,

Your IF statement is tautological. That is it always evaluates to the
same result.

If Not IsEmpty("D20") Then
Sheets("Sr-Area Manager").PrintOut Copies:=1, Collate:=True
Else
Sheets("Sr-Area Manager").PrintOut Copies:=1, Collate:=False
End If

Change it to this...

If Not IsEmpty("D20") Then
Sheets("Sr-Area Manager").PrintOut Copies:=1, Collate:=True
End If

Sincerely,
Leith Ross


--
Leith Ross
------------------------------------------------------------------------
Leith Ross's Profile: http://www.thecodecage.com/forumz/member.php?userid=75
View this thread: http://www.thecodecage.com/forumz/sh...ad.php?t=45557

 
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
Differentiate between 'Print' and 'Print Preview' in VBA code Mattantaliss Excel Programming 4 April 17th 06 09:31 PM
Code before Print but not Print Preview widemonk Excel Programming 1 November 14th 05 01:48 PM
Need Code To Print From Code Modules davidm Excel Programming 0 June 7th 05 06:11 AM
Need Code To Print From Code Modules davidm Excel Programming 0 June 7th 05 06:08 AM
Need print code please Rodders[_2_] Excel Programming 2 September 20th 03 12:35 AM


All times are GMT +1. The time now is 01:53 PM.

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

About Us

"It's about Microsoft Excel"