this is my first post here an i am very beginner of excel vba
my question is
i have a userform with
textbox1
textbox2
textbox3
and CommandButton1
in my excel sheet in first colam i have numbers
if the data i type in textbox1 in cell "A" it shows the result of Cell "b" in textbox2. that is ok i can
with this code
i want that it show the row number in TextBox3
is that Possible?
my question is
i have a userform with
textbox1
textbox2
textbox3
and CommandButton1
in my excel sheet in first colam i have numbers
if the data i type in textbox1 in cell "A" it shows the result of Cell "b" in textbox2. that is ok i can
with this code
Code:
Private Sub CommandButton1_Click()TextBox2.Text = Clear
TextBox3.Text = Clear
Dim apple As Long
Dim test As Long
apple = Sheets("sheet1").Range("a" & Rows.Count).End(xlUp).Row
For test = 1 To apple
If Sheets("sheet1").Cells(test, 1).Text = TextBox1.Value Then
TextBox2.Text = Sheets("sheet1").Cells(test, 2)
End If
Next test
End Sub
i want that it show the row number in TextBox3
is that Possible?