How can I specify that with each For/next cycle, the number of the textbox should increase by one, from Userform1.Textbox1 to Userform1.Textbox2 and so on for each sheet in the workbook?
I am trying "UserForm1.TextBox & i" and "i = i + 1" But I get a syntax error.
Any advice?
Application.ScreenUpdating = False
SheetName = ActiveSheet.Name
FindString = InputBox("Enter the case number to search for:")
i = 1
For Each ws In Worksheets
If ws.Name Like "lang*" Then
With ws
If Trim(FindString) <> "" Then
With Sheets(1).Range("A:A")
Set Rng = .Find(What:=FindString, _
After:=.Cells(.Cells.Count), _
LookIn:=xlValues, _
LookAt:=xlWhole, _
SearchOrder:=xlByRows, _
SearchDirection:=xlNext, _
MatchCase:=False)
If Not Rng Is Nothing Then
UserForm1.TextBox & i = ActiveSheet.Name & " " & _
Rng.Offset(0, 2).Value & " " & _
i = i + 1
Else: GoTo NotFound
End If
End With
End If
End With
End If
Next ws
Sheets(SheetName).Activate
Application.ScreenUpdating = True
UserForm1.Show