Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 309
Default Calendar Control 8.0 question

Is it possible to restrict the date ranges of the Calendar
Control 8.0?? I only want the year 2009 to be selected
from the drop down box.

Thank you!


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 206
Default Calendar Control 8.0 question

You can't change what is in the drop-down for years, but you can limit the
year to 2009 on the calendar even if they select another year from the
drop-down. Put the following code in the Worksheet code module that your
calendar is on.

Private Sub Calendar1_NewYear()
Calendar1.Year = 2009
End Sub


Mike F

"Robert Crandal" wrote in message
...
Is it possible to restrict the date ranges of the Calendar
Control 8.0?? I only want the year 2009 to be selected
from the drop down box.

Thank you!




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 309
Default Calendar Control 8.0 question

Thank you! That code works great. Just what I'm looking for!

"Mike Fogleman" wrote in message
...
You can't change what is in the drop-down for years, but you can limit the
year to 2009 on the calendar even if they select another year from the
drop-down. Put the following code in the Worksheet code module that your
calendar is on.

Private Sub Calendar1_NewYear()
Calendar1.Year = 2009
End Sub



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 309
Default Calendar Control 8.0 question

Hi again Mike. I just had another follow-up question....

Do you know if I can limit the calendar to only a couple
years?? For example, what if I wanted to limit it
to 2009 AND 2010 AND 2011?? How would the
code look then??


"Mike Fogleman" wrote in message
...

You can't change what is in the drop-down for years, but you can limit the
year to 2009 on the calendar even if they select another year from the
drop-down. Put the following code in the Worksheet code module that your
calendar is on.

Private Sub Calendar1_NewYear()
Calendar1.Year = 2009
End Sub


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 206
Default Calendar Control 8.0 question

Private Sub Calendar1_AfterUpdate()
If Calendar1.Year 2011 Then Calendar1.Year = 2011
If Calendar1.Year < 2009 Then Calendar1.Year = 2009
End Sub

Mike F
"Robert Crandal" wrote in message
...
Hi again Mike. I just had another follow-up question....

Do you know if I can limit the calendar to only a couple
years?? For example, what if I wanted to limit it
to 2009 AND 2010 AND 2011?? How would the
code look then??


"Mike Fogleman" wrote in message
...

You can't change what is in the drop-down for years, but you can limit
the year to 2009 on the calendar even if they select another year from
the drop-down. Put the following code in the Worksheet code module that
your calendar is on.

Private Sub Calendar1_NewYear()
Calendar1.Year = 2009
End Sub






  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 309
Default Calendar Control 8.0 question

Ugghhh..... Guess what Mike? I can't use Calendar Control 8.0 at
work. I can only use Microsoft Date & Time Picker 6.0.

Do you know how to do this same thing with MS DT Picker 6.0?
I tried the following code below, but it doesnt seem to work:

Private Sub DTPicker1_AfterUpdate()
If DTPicker1.Year 2011 Then DTPicker1.Year = 2011
If DTPicker1.Year < 2009 Then DTPicker1.Year = 2009
End Sub

Maybe I forgot to initialize something??

Thanks sooooooo much for your help!

"Mike Fogleman" wrote in message
...
Private Sub Calendar1_AfterUpdate()
If Calendar1.Year 2011 Then Calendar1.Year = 2011
If Calendar1.Year < 2009 Then Calendar1.Year = 2009
End Sub

Mike F


  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 206
Default Calendar Control 8.0 question

Select the DTPicker, select Design mode, and in the property settings, set
the Max date & Min Date.

Mike F
"Robert Crandal" wrote in message
...
Ugghhh..... Guess what Mike? I can't use Calendar Control 8.0 at
work. I can only use Microsoft Date & Time Picker 6.0.

Do you know how to do this same thing with MS DT Picker 6.0?
I tried the following code below, but it doesnt seem to work:

Private Sub DTPicker1_AfterUpdate()
If DTPicker1.Year 2011 Then DTPicker1.Year = 2011
If DTPicker1.Year < 2009 Then DTPicker1.Year = 2009
End Sub

Maybe I forgot to initialize something??

Thanks sooooooo much for your help!

"Mike Fogleman" wrote in message
...
Private Sub Calendar1_AfterUpdate()
If Calendar1.Year 2011 Then Calendar1.Year = 2011
If Calendar1.Year < 2009 Then Calendar1.Year = 2009
End Sub

Mike F




  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 309
Default Calendar Control 8.0 question

Thanks for the awesome advice Mike!

"Mike Fogleman" wrote in message
...

Select the DTPicker, select Design mode, and in the property settings, set
the Max date & Min Date.

Mike F


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
click on calendar control calendar but want to return the DAY of retired bill Excel Programming 13 May 9th 09 01:57 AM
monthview calendar question/ want the calendar to display weekdays only.. [email protected] Excel Programming 0 August 26th 07 09:25 PM
Control disappeared problem - specifically, the Calendar Control JMMach[_2_] Excel Programming 0 December 16th 05 01:53 AM
Calendar Control: Can't exit design mode because control can't be created Rone Excel Programming 0 May 24th 04 04:01 PM
Calendar Control Kelly Excel Programming 3 February 19th 04 09:36 PM


All times are GMT +1. The time now is 10:50 AM.

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"