Popup Calendar Problem

wsautrey

New Member
Joined
Apr 2, 2011
Messages
21
Excel 2010
When I select the target cell/s the calendar appears and I am able to make selection on calendar. However, after date is selected on calendar I have to click on the date in the control to force the date to transfer to cell and make date control (DTPicker) go away. Would like to have the date appear in target cell after date selection in control and calendar to exit afterward without having to select the date again. I originally used this code in Excel 2003 but calendar control is no longer available for usage in 2010. I am sure the code needs to be tweaked to make the transition to 2010.

Thanks!



Private Sub Worksheet_SelectionChange(ByVal Target As Range)

Dim rng As Range

Set rng = Intersect(Target, D010.Range("IncidentDes"))
If Not rng Is Nothing Then
Load frmTextEntry
frmTextEntry.Show
D010.Range("SC1").Select
Else
If Not Application.Intersect(Range("AZ69:AZ77,K6,K7,K81,AQ81"), Target) Is Nothing Then
DTPicker21.Left = Target.Left + Target.Width - DTPicker21.Width
DTPicker21.Top = Target.Top + Target.Height
DTPicker21.Visible = True
' select Today's date in the Calendar
DTPicker21.Value = Date
ElseIf DTPicker21.Visible Then
DTPicker21.Visible = False
End If
End If

End Sub
__________________________________________________________________
Private Sub DTPicker21_Click()
ActiveCell.Value = CDbl(DTPicker21.Value)
ActiveCell.Select
DTPicker21.Visible = False
End Sub
 

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
Am using 64 bit on this machine. Do you see anything wrong with this code to prevent it from doing what I need? We are moving to Windows 7 / Office 2010 at work and I am pretty sure it will be OS will be 64 bit. Not sure about Office.
 
Upvote 0

Forum statistics

Threads
1,224,597
Messages
6,179,813
Members
452,945
Latest member
Bib195

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top