Jord57
09-27-2017, 05:07 AM
Hi
Firstly I am a complete novice at VBA. I have used the Microsoft date and time picker control output to input dates into a column. I want to be able to filter that column using the filter function at the top. However every time I try to filter I get a pop-up with "runtime error 440 Invalid code value". I assume its because I have set specific cell values in the VBA code and filtering changes these values. This is the code I have used:
Private Sub DTPicker21_CallbackKeyDown(ByVal KeyCode As Integer, ByVal Shift As Integer, ByVal CallbackField As String, CallbackDate As Date)
End Sub
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
With Sheet1.DTPicker21
.Height = 20
.Width = 20
If Not Intersect(Target, Range("G5:G3000,H5:H3000,I5:I3000")) Is Nothing Then
.Visible = True
.Top = Target.Top
.Left = Target.Offset(0, 1).Left
.LinkedCell = Target.Address
Else
.Visible = False
End If
End With
End Sub
Any Help with this would be much appreciated.
Thanks
Firstly I am a complete novice at VBA. I have used the Microsoft date and time picker control output to input dates into a column. I want to be able to filter that column using the filter function at the top. However every time I try to filter I get a pop-up with "runtime error 440 Invalid code value". I assume its because I have set specific cell values in the VBA code and filtering changes these values. This is the code I have used:
Private Sub DTPicker21_CallbackKeyDown(ByVal KeyCode As Integer, ByVal Shift As Integer, ByVal CallbackField As String, CallbackDate As Date)
End Sub
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
With Sheet1.DTPicker21
.Height = 20
.Width = 20
If Not Intersect(Target, Range("G5:G3000,H5:H3000,I5:I3000")) Is Nothing Then
.Visible = True
.Top = Target.Top
.Left = Target.Offset(0, 1).Left
.LinkedCell = Target.Address
Else
.Visible = False
End If
End With
End Sub
Any Help with this would be much appreciated.
Thanks