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
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