1 Attachment(s)
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!!
Re: Return data in text boxes
what does this mean?
you get error, wrong result or nothing?
does the code run at all? do you get any message box at all?
Re: Return data in text boxes
Hi.
I have 2 worksheets named 'AGOSTO' and another called 'SETEMBRO'
I need the Textbox's return (if TextBox1 .... until TextBox6) if ComboBox1 is 'AGOSTO' then it will be searched in the worksheet 'AGOSTO' and will ComboBox2 statement based on the date.
after that the data is returned to the Textbox's
Re: Return data in text boxes
i still do not understand what the problem is you are having to put the data in the textboxes
i can only see code to put data into textbox1
Re: Return data in text boxes
Hi.
That was what i tried to do.
But not much of VBA.
can you help me?
Thank you!