Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 148
Default Printing, VB - based on dates

Hi,

I have a workbook with several worksheets that I let my officemates use.
However, when they are done with their work using my workbook, they cannot
print any of the worksheets so I have to print it for them.

Is there a way that I can let them print based on:
1. Day, say on 8-16-07 or
2. a week, say from 8-20-07 to 8-24?

Please help modify the macro below or help me write a macro.

Private Sub Workbook_BeforePrint(Cancel As Boolean)
Cancel = True
End Sub

Thank you.


  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 130
Default Printing, VB - based on dates

Private Sub Workbook_BeforePrint(Cancel As Boolean)
If Date < VBA.DateSerial(2007,8,16) Then
Cancel = True
End If
End Sub

--

Sincerely,

Ronald R. Dodge, Jr.
Master MOUS 2000

"Danny" wrote in message
...
Hi,

I have a workbook with several worksheets that I let my officemates use.
However, when they are done with their work using my workbook, they cannot
print any of the worksheets so I have to print it for them.

Is there a way that I can let them print based on:
1. Day, say on 8-16-07 or
2. a week, say from 8-20-07 to 8-24?

Please help modify the macro below or help me write a macro.

Private Sub Workbook_BeforePrint(Cancel As Boolean)
Cancel = True
End Sub

Thank you.




  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 148
Default Printing, VB - based on dates

It worked, thanks a lot!
How about #2 for inclusive dates?

"Ronald Dodge" wrote:

Private Sub Workbook_BeforePrint(Cancel As Boolean)
If Date < VBA.DateSerial(2007,8,16) Then
Cancel = True
End If
End Sub

--

Sincerely,

Ronald R. Dodge, Jr.
Master MOUS 2000

"Danny" wrote in message
...
Hi,

I have a workbook with several worksheets that I let my officemates use.
However, when they are done with their work using my workbook, they cannot
print any of the worksheets so I have to print it for them.

Is there a way that I can let them print based on:
1. Day, say on 8-16-07 or
2. a week, say from 8-20-07 to 8-24?

Please help modify the macro below or help me write a macro.

Private Sub Workbook_BeforePrint(Cancel As Boolean)
Cancel = True
End Sub

Thank you.





  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 10,593
Default Printing, VB - based on dates

Private Sub Workbook_BeforePrint(Cancel As Boolean)
If Date < DateSerial(2007,8,20) Or _
Date DateSerial(2007,8,24) Then
Cancel = True
End If
End Sub


--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"Danny" wrote in message
...
It worked, thanks a lot!
How about #2 for inclusive dates?

"Ronald Dodge" wrote:

Private Sub Workbook_BeforePrint(Cancel As Boolean)
If Date < VBA.DateSerial(2007,8,16) Then
Cancel = True
End If
End Sub

--

Sincerely,

Ronald R. Dodge, Jr.
Master MOUS 2000

"Danny" wrote in message
...
Hi,

I have a workbook with several worksheets that I let my officemates
use.
However, when they are done with their work using my workbook, they
cannot
print any of the worksheets so I have to print it for them.

Is there a way that I can let them print based on:
1. Day, say on 8-16-07 or
2. a week, say from 8-20-07 to 8-24?

Please help modify the macro below or help me write a macro.

Private Sub Workbook_BeforePrint(Cancel As Boolean)
Cancel = True
End Sub

Thank you.







  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 148
Default Printing, VB - based on dates

It worked perfectly! Thanks a lot gentlemen.

"Bob Phillips" wrote:

Private Sub Workbook_BeforePrint(Cancel As Boolean)
If Date < DateSerial(2007,8,20) Or _
Date DateSerial(2007,8,24) Then
Cancel = True
End If
End Sub


--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"Danny" wrote in message
...
It worked, thanks a lot!
How about #2 for inclusive dates?

"Ronald Dodge" wrote:

Private Sub Workbook_BeforePrint(Cancel As Boolean)
If Date < VBA.DateSerial(2007,8,16) Then
Cancel = True
End If
End Sub

--

Sincerely,

Ronald R. Dodge, Jr.
Master MOUS 2000

"Danny" wrote in message
...
Hi,

I have a workbook with several worksheets that I let my officemates
use.
However, when they are done with their work using my workbook, they
cannot
print any of the worksheets so I have to print it for them.

Is there a way that I can let them print based on:
1. Day, say on 8-16-07 or
2. a week, say from 8-20-07 to 8-24?

Please help modify the macro below or help me write a macro.

Private Sub Workbook_BeforePrint(Cancel As Boolean)
Cancel = True
End Sub

Thank you.








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
Printing consecutive dates Bradford88 Excel Discussion (Misc queries) 1 January 22nd 07 07:33 PM
how do i omit rows for printing based on column value haloprod Excel Discussion (Misc queries) 1 April 5th 06 04:59 AM
Printing dates on 1 spreadsheet Megan Excel Discussion (Misc queries) 0 March 13th 06 05:09 PM
Printing point on graph in different color based on pos or neg Carol Charts and Charting in Excel 1 June 23rd 05 12:31 AM
Can I select a worksheet based upon a cell criteria?(for printing) Tim Richards Excel Worksheet Functions 0 March 30th 05 07:03 PM


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