Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
JAD JAD is offline
external usenet poster
 
Posts: 43
Default Date & Time Picker Control 6.0

I would like for the Date & Time Picker Control 6.0 to appear whenever a user
double clicks on a cell that requires a date. As an example, if the user is
in the worksheet named "WS1" and double clicks on cell "B11", the ActiveX
control will appear, allow you to select a date and then enter that date into
cell B11. Once entered, the Date & Time Picker Control 6.0 will disappear.
Any help would be appreciated. Thank You, JAD
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Date & Time Picker Control 6.0

Use a worksheet changge function which will make the control visible when you
need to make an entry and then make it invisible after the entry is made.

"JAD" wrote:

I would like for the Date & Time Picker Control 6.0 to appear whenever a user
double clicks on a cell that requires a date. As an example, if the user is
in the worksheet named "WS1" and double clicks on cell "B11", the ActiveX
control will appear, allow you to select a date and then enter that date into
cell B11. Once entered, the Date & Time Picker Control 6.0 will disappear.
Any help would be appreciated. Thank You, JAD

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default Date & Time Picker Control 6.0

Add the Date & Time Picker control to the worksheet's Control Toolbox (I am
not using a UserForm for this), then place it anywhere on worksheet WS1.
Then right click WS1's tab to go to the code window for that worksheet and
copy paste this code into that code window...

'***************** START OF CODE *****************
Dim CurrentDTPickerCell As Range

Private Sub DTPicker1_CloseUp()
CurrentDTPickerCell.Value = DTPicker1.Value
DTPicker1.Visible = False
End Sub

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, _
Cancel As Boolean)
If Not Intersect(Target, Range("A10,B11,C12")) Is Nothing Then
Cancel = True
Set CurrentDTPickerCell = Target
DTPicker1.Visible = True
DTPicker1.Top = Target.Top
DTPicker1.Left = Target.Left + Target.Width + 1
End If
End Sub

Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("A10,B11,C12")) Is Nothing Then
If DTPicker1.Visible Then DTPicker1.Visible = False
End If
End Sub

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If DTPicker1.Visible Then DTPicker1.Visible = False
End Sub
'***************** END OF CODE *****************

Simply change the range of values that this functionality should apply to in
both the BeforeDoubleClick and the Change events and you are done... go to
WK1 and start to use it. As set up, double clicking A10, B11 or C12 will
bring up the date picker control next to the cell allowing you to select a
date from there.

--
Rick (MVP - Excel)


"JAD" wrote in message
...
I would like for the Date & Time Picker Control 6.0 to appear whenever a
user
double clicks on a cell that requires a date. As an example, if the user
is
in the worksheet named "WS1" and double clicks on cell "B11", the ActiveX
control will appear, allow you to select a date and then enter that date
into
cell B11. Once entered, the Date & Time Picker Control 6.0 will disappear.
Any help would be appreciated. Thank You, JAD


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 rapleyj Excel Discussion (Misc queries) 0 April 30th 10 05:37 AM
date and time picker control Ashku Excel Discussion (Misc queries) 0 July 22nd 06 11:18 AM
date time picker control MacroCharlie Excel Programming 0 November 16th 05 04:01 PM
Date and Time Picker Control problem Andy Tallent Excel Discussion (Misc queries) 0 May 4th 05 12:50 PM
Date and Time Picker Control Andy T Excel Discussion (Misc queries) 0 January 6th 05 04:09 PM


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