LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Syntax of If statement in before print event


In the before print event, I need code to execute only for a particula
worksheet named "Checks" (code name Sheet2). I have tried th
following as well as variations but can't get the if statement to wor
properly:

Private Sub Workbook_BeforePrint(Cancel As Boolean)
If Active.Worksheets.Name = "Checks" Then
(code goes here)
Else
(other code goes here)
End If
End Sub

I'm trying to keep it simple. Any ideas? Thanks so very much
mikebur

--
mikebur
-----------------------------------------------------------------------
mikeburg's Profile: http://www.excelforum.com/member.php...fo&userid=2458
View this thread: http://www.excelforum.com/showthread.php?threadid=46635

 
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
IF statement syntax Sander Excel Discussion (Misc queries) 4 July 14th 09 06:04 PM
if statement syntax help OfficeManager Excel Worksheet Functions 6 July 23rd 08 08:09 PM
need help with syntax of if statement Melody Excel Worksheet Functions 3 February 15th 08 05:05 PM
need help with syntax of a Workbook Event Paul Simon[_2_] Excel Programming 3 July 30th 03 03:43 AM


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