Private Sub TextBox1_Change()
Dim c As Range, sAddr As String, i As Long
With ThisWorkbook.ActiveSheet
With .Range("B1", .Cells(.Rows.Count, "B").End(xlUp))
Set c = .Find(What:=CStr(TextBox1.Value), LookIn:=xlValues, LookAt:=xlWhole, SearchOrder:=xlByRows)
If Not c Is Nothing Then
sAddr = c.Address
Do
i = i + 1
Set c = .FindNext(c)
Loop While Not c Is Nothing And sAddr <> c.Address
End If
TextBox2.Value = i
End With
End With
End Sub
Hi I currently have this code, however, I want the textbox 2 value to +1, after typing the same number that can be found in the column B twice. Thanksss
Dim c As Range, sAddr As String, i As Long
With ThisWorkbook.ActiveSheet
With .Range("B1", .Cells(.Rows.Count, "B").End(xlUp))
Set c = .Find(What:=CStr(TextBox1.Value), LookIn:=xlValues, LookAt:=xlWhole, SearchOrder:=xlByRows)
If Not c Is Nothing Then
sAddr = c.Address
Do
i = i + 1
Set c = .FindNext(c)
Loop While Not c Is Nothing And sAddr <> c.Address
End If
TextBox2.Value = i
End With
End With
End Sub
Hi I currently have this code, however, I want the textbox 2 value to +1, after typing the same number that can be found in the column B twice. Thanksss