DTPicker1 run time issue

GerryBriant

New Member
Joined
Jan 15, 2018
Messages
16
Hi,
Newbie here .... Can anyone suggest how I can resolve the following Run-time error. I am using DTPicker1 & was hoping that it would only appear when any cell in column “D:E" is selected.
I would prefer not to enable the checkbox as its slows down the date entry (& looks messy!).
Run-time error ‘440’:
Can’t set value to Null when CheckBox property = False.
Current VB code is:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
With Sheet1.DTPicker1
If Not Intersect(Target, Range("D:E")) Is Nothing Then
.Height = 200
.Width = 200
.Visible = True
.Top = Target.Top
.Left = Target.Offset(0, 1).Left
.LinkedCell = Target.Address
Else
.Visible = False
End If
End With
End Sub
Private Sub DTPicker1_Change()
Dim Cell As Object
For Each Cell In Selection.Cells
Cell.Value = Me.DTPicker1.Value
Next Cell
End Sub
 

Some videos you may like

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.

GerryBriant

New Member
Joined
Jan 15, 2018
Messages
16
Apologies if the post is too basic but I cannot understand why or how to resolve the issue.
 

Watch MrExcel Video

Forum statistics

Threads
1,123,514
Messages
5,602,093
Members
414,501
Latest member
mdhaumyu

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
Top