How to find Startdate - Enddate in userform, and search in all columns

I am new here and this is my first post. I am new in excel vba and i am asking your help.

I have a file that has a searchform. I want help in 2 items:

In Sheets("Production") i have data in Columns A-J. The 1st Column is a date and I want to make an option to choose StartDate and EndDate of search in the form.
For example I have in the sheet dates from 01/01/2014 until 08/02/2014 and I want to choose StartDate and EndDate between them.

The other one is the search of words in the Textbox. Now it is only on Column A and I want it to be on all the used Columns. But when I change in the code to all the Columns A-L it is showing me in the listbox only data from the Cell to the end and not from Column A to the end.
Thanks in advance.

Here's the code:

Private Sub TitleBox_Change()
    Dim ws As Worksheet
    ListBox.Clear
    Locate TitleBox.Text, Worksheets("production").Range("a:a")
    If ListBox.ListCount = 0 Then
        ListBox.AddItem "-"
        ListBox.List(0, 1) = ""
        ListBox.List(0, 2) = ""
        ListBox.List(0, 3) = ""
        ListBox.List(0, 4) = ""
        ListBox.List(0, 5) = ""
        ListBox.List(0, 6) = ""
        ListBox.List(0, 7) = ""
        ListBox.List(0, 8) = ""
        ListBox.List(0, 9) = ""
    End If
End Sub

Sub Locate(Name As String, Data As Range)
    Dim rngFind As Range
    Dim strFirstFind As String

    On Error Resume Next

    With Data
        Set rngFind = .Find(Name, LookIn:=xlValues, lookat:=xlPart)
        If Not rngFind Is Nothing Then
            strFirstFind = rngFind.Address
            Do
                If rngFind.Row > 1 Then
                    ListBox.AddItem rngFind.Value
                    ListBox.List(ListBox.ListCount - 1, 0) = rngFind.Cells(1, "a")
                    ListBox.List(ListBox.ListCount - 1, 1) = rngFind.Cells(1, "b")
                    ListBox.List(ListBox.ListCount - 1, 2) = rngFind.Cells(1, "c")
                    ListBox.List(ListBox.ListCount - 1, 3) = rngFind.Cells(1, "d")
                    ListBox.List(ListBox.ListCount - 1, 4) = rngFind.Cells(1, "e")
                    ListBox.List(ListBox.ListCount - 1, 5) = rngFind.Cells(1, "f")
                    ListBox.List(ListBox.ListCount - 1, 6) = rngFind.Cells(1, "g")
                    ListBox.List(ListBox.ListCount - 1, 7) = rngFind.Cells(1, "h")
                    ListBox.List(ListBox.ListCount - 1, 8) = rngFind.Cells(1, "i")
                    ListBox.List(ListBox.ListCount - 1, 9) = rngFind.Cells(1, "j")
                End If
            Set rngFind = .FindNext(rngFind)
            Loop While Not rngFind Is Nothing And rngFind.Address <> strFirstFind
        End If
    End With
End Sub

Private Sub UserForm_Initialize()
    TextBox12.Text = Sheets("main").Range("L2").Text
    TextBox12.Value = Format(TextBox12.Value, "mm-dd-yyyy")
    TextBox13.Text = Sheets("main").Range("L3").Text
    TextBox13.Value = Format(TextBox13.Value, "mm-dd-yy")
End Sub

Answers


Is this what you are trying?

Code

Private Sub UserForm_Initialize()        
    TextBox12.Value = Format(Sheets("main").Range("L2").Value, "mm-dd-yyyy")
    TextBox13.Value = Format(Sheets("main").Range("L3").Value, "mm-dd-yyyy")
End Sub

Private Sub MenuButton_Click()
    Unload Me
End Sub

Sub Locate(Name As String, Data As Range)
    Dim rngFind As Range
    Dim strFirstFind As String

    With Data
        Set rngFind = .Find(Name, LookIn:=xlValues, lookat:=xlPart)
        If Not rngFind Is Nothing Then
            strFirstFind = rngFind.Address
            Do
                If rngFind.Row > 1 Then
                    ListBox.AddItem .Cells(rngFind.Row, 1)
                    ListBox.List(ListBox.ListCount - 1, 2) = .Cells(rngFind.Row, 2)
                    ListBox.List(ListBox.ListCount - 1, 3) = .Cells(rngFind.Row, 3)
                    ListBox.List(ListBox.ListCount - 1, 4) = .Cells(rngFind.Row, 4)
                    ListBox.List(ListBox.ListCount - 1, 5) = .Cells(rngFind.Row, 5)
                    ListBox.List(ListBox.ListCount - 1, 6) = .Cells(rngFind.Row, 6)
                    ListBox.List(ListBox.ListCount - 1, 7) = .Cells(rngFind.Row, 7)
                    ListBox.List(ListBox.ListCount - 1, 8) = .Cells(rngFind.Row, 8)
                    ListBox.List(ListBox.ListCount - 1, 9) = .Cells(rngFind.Row, 9)                     
                End If
                Set rngFind = .FindNext(rngFind)
            Loop While Not rngFind Is Nothing And rngFind.Address <> strFirstFind
        End If
    End With

End Sub

Private Sub TitleBox_Change()
    Dim ws As Worksheet

    ListBox.Clear

    Locate TitleBox.Text, Worksheets("production").Range("a:j")

    If ListBox.ListCount = 0 Then
        ListBox.AddItem "-"
        ListBox.List(0, 1) = ""
        ListBox.List(0, 2) = ""
        ListBox.List(0, 3) = ""
        ListBox.List(0, 4) = ""
        ListBox.List(0, 5) = ""
        ListBox.List(0, 6) = ""
        ListBox.List(0, 7) = ""
        ListBox.List(0, 8) = ""
        ListBox.List(0, 9) = ""
    End If
End Sub

ScreenShot:


Need Your Help

Architecture suggestions for a location based cross-platform mobile app project?

geolocation cross-platform leaflet ionic hybrid-mobile-app

I want to develop a location based cross-platform mobile app for a university campus. I want it to be like foursquare basicly.

Excel VBA - Run-time error '9', Subscript out of range

excel vba excel-vba

I really appreciate any help I can get on this.