Try this Userform.
Private Sub UserForm_Activate()
For i = 1 To ActiveWorkbook.Sheets.Count
TN = ActiveWorkbook.Sheets(i).Name
If TN = "Main" Or TN = "Useful Code" Or TN = MyTeam Then GoTo Skip
Flag = 0
ComboBox1.AddItem ActiveWorkbook.Sheets(i).Name
ComboBox2.AddItem ActiveWorkbook.Sheets(i).Name
Skip:
Next i
End Sub
Private Sub Loader()
If ComboBox1.Value = "" Or ComboBox2.Value = "" Then Exit Sub
With Sheets(ComboBox1.Value)
On Error Resume Next
Set Z = .Columns(1).Find(ComboBox2.Value, LookIn:=xlValues, Lookat:=xlWhole)
t = Z.Row
If t > 0 Then
For Count = 1 To 4
Me.Controls("Textbox" & Count).Text = .Cells(t, Count + 1).Value
Next
End If
Adder
On Error GoTo 0
End With
End Sub
Private Sub Adder()
If Changeflag = True Then Exit Sub
For Count = 1 To 4
If Me.Controls("Textbox" & Count).Text = "" Then Me.Controls("Textbox" & Count).Text = "0"
Next
TextBox5.Value = TextBox1.Value * 1 + TextBox3.Value * 1
TextBox6.Value = TextBox2.Value * 1 + TextBox4.Value * 1
End Sub
Change this line above.
If TN = "Main" Or TN = "Useful Code" Or TN = MyTeam Then GoTo Skip
To
If TN = "Main" Or TN = "Useful Code" Then GoTo Skip
To avoid confusing yourself.
I was going to use MyTeam to create the Userform as you described it.
But then i decided that your solution was over complicated and sarted again.
Bookmarks