Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 142
Default Microsoft Date and Time Picker control for User Form

I found this handy little control recently and was wondering whether it is
possible to refer to a cell in a worksheet in the MaxDate field. This is for
a workbook I update every month and I don't want anyone to be able to select
a date that is past the end of the month. I know I can write a small test
for it, but I'd rather just use the MaxDate field. Can it be done that way?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,298
Default Microsoft Date and Time Picker control for User Form

you can't set the property directly to a range, so do it when the form
initialises:

Private Sub UserForm_Initialize()
DTPicker1.MaxDate = Range("B2")
End Sub

where B2 is a date. Tested fine

"Luke" wrote:

I found this handy little control recently and was wondering whether it is
possible to refer to a cell in a worksheet in the MaxDate field. This is for
a workbook I update every month and I don't want anyone to be able to select
a date that is past the end of the month. I know I can write a small test
for it, but I'd rather just use the MaxDate field. Can it be done that way?

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 142
Default Microsoft Date and Time Picker control for User Form

Ahhh, that will work nicely. The more I learn about this stuff, the more I
realize there is so much I don't know.

Thanks for the quick response.

"Patrick Molloy" wrote:

you can't set the property directly to a range, so do it when the form
initialises:

Private Sub UserForm_Initialize()
DTPicker1.MaxDate = Range("B2")
End Sub

where B2 is a date. Tested fine

"Luke" wrote:

I found this handy little control recently and was wondering whether it is
possible to refer to a cell in a worksheet in the MaxDate field. This is for
a workbook I update every month and I don't want anyone to be able to select
a date that is past the end of the month. I know I can write a small test
for it, but I'd rather just use the MaxDate field. Can it be done that way?

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
Microsoft Date and Time Picker Control 6.0 forest8 Excel Discussion (Misc queries) 5 April 2nd 23 08:11 PM
Microsoft date and time picker control rapleyj Excel Discussion (Misc queries) 0 April 30th 10 05:37 AM
microsoft date and time picker nelson Excel Discussion (Misc queries) 3 September 7th 09 08:30 AM
Microsoft Date and Time Picker Control 6.0 (SP6) question [email protected] Excel Discussion (Misc queries) 0 July 23rd 07 08:00 PM
microsoft date and time picker control Don Excel Discussion (Misc queries) 2 May 20th 05 02:27 PM


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