Not MS DatePicker & restrict entries to certain range

Eric Carolus

Board Regular
Joined
Sep 17, 2012
Messages
133
Office Version
  1. 2016
Platform
  1. Windows
Hi folks
I downloaded a DatePicker from Calendar Control for All Office versions - including Office 2016 64 bit (With Advanced Features) - E90E50

I have searched the literature how to restrict DatePicker entry to certain ranges (for dates). and found the following code

Option Explicit
Private Sub Worksheet_SelectionChange(ByVal Target As Range)

‘ One cell had been selected
If Selection.Count = 1 Then
If Not Intersect(Target, Range("C8:C32;H8:I32")) Is Nothing Then
‘Call MyMacro
Call Calendar1_Click
End If
End If
End Sub

My request for assistance is:
a). to restrict date picker entry to a certain range(s)
b). format other range(s) for hh:mm to prevent date entry by the DatePicker.

The formatting option of MS Excel does not work for me.

Thanks for the assistance in advance.

Eric Carolus
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
Hi Folks

I found the solution!

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)

If Not Intersect(Range("A6,C6"), Target) Is Nothing Then

'----------------------------------
' Open DatePicker
Set DatePickerForm.Target = Target.Cells(1, 1)
DatePickerForm.Show vbModal
Cancel = True
'----------------------------------
End If

End Sub

Thank you.

Eric Carolus
 
Upvote 0

Forum statistics

Threads
1,223,229
Messages
6,170,881
Members
452,364
Latest member
springate

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