Results 1 to 5 of 5

Thread: Return data in text boxes

Threaded View

  1. #1

    Thread Starter
    Member
    Join Date
    Mar 2012
    Posts
    33

    Return data in text boxes

    Hi.
    I need to return to the Textbox's values ​​according to ComboBox1 (el dira the tab name, to return) and ComboBox2 (he will tell you the date the information is returned).
    does not work
    Code:
    Private Sub ComboBox2_Exit(ByVal Cancel As MSForms.ReturnBoolean) 
         
         
        Dim vrNum As String 
        Dim vr1 As String 
        Dim qt As Integer 
         
        qt = Sheets(ComboBox1.Text).[A3].CurrentRegion.Rows.Count 
         
        Application.EnableEvents = False 
         
        On Error Resume Next 
        vrNum = CDate(Me.ComboBox2) 
         
        If vrNum = "" Then 
            MsgBox "Insira uma data valida" 
            Me.ComboBox2 = "" 
            Application.EnableEvents = True 
            Exit Sub 
        Else 
            On Error Resume Next 
            vr1 = Application.WorksheetFunction.VLookup(vrNum, Worksheets(ComboBox1).Range("A3:G" & qt), 2, 0) '=PROCV
             
            Me.TextBox1 = vr1 
            If vr1 = "" Then 
                MsgBox "não possui faturamento." 
            End If 
            Application.EnableEvents = True 
        End If 
    End Sub
    Cross-Post
    http://www.thecodecage.com/forumz/mi...ext-boxes.html
    Thank you!!
    Attached Files Attached Files

Posting Permissions

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



Click Here to Expand Forum to Full Width