Results 1 to 4 of 4

Thread: Filter the microsoft date and time picker control output

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    VBAX Newbie
    Joined
    Sep 2017
    Posts
    2
    Location

    Filter the microsoft date and time picker control output

    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
    Last edited by SamT; 09-27-2017 at 06:32 AM. Reason: Added Code formatting Tags with # Icon

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •