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
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.

Forum statistics

Threads
1,213,585
Messages
6,114,518
Members
448,575
Latest member
hycrow

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