Private Sub ComboBox1_Change()
Dim result As Range, x As Integer, CtrlSrc As String
Dim c14 As Integer, c13 As Integer
On Error Resume Next
Set result = SearchRange.Find(ComboBox1.Text, , xlValues, xlWhole)
If result <> "Name" Then
CtrlSrc = result.Parent.Name & "!" & result.Offset(, x).Address
c13 = result.Offset(0, 13).Value
c14 = result.Offset(0, 14).Value
result.Offset(0, 12).Value = tb_12
result.Offset(0, 13).Value = tb_12 + c13
result.Offset(0, 14).Value = c14 + tb_12
End If
End Sub
Private Sub UserForm_Initialize()
Dim R As Range
Set SearchRange = ThisWorkbook.Names("SearchRange").RefersToRange
For Each R In SearchRange
ComboBox1.AddItem R.Text
Next
End Sub
Dim bSkipEvents as Boolean ' this goes before all routines in the userform
Private Sub ComboBox1_Change()
If bSkipEvents then exit sub
Dim result As Range, x As Integer, CtrlSrc As String
Dim c14 As Integer, c13 As Integer
On Error Resume Next
Set result = SearchRange.Find(ComboBox1.Text, , xlValues, xlWhole)
If result <> "Name" Then
CtrlSrc = result.Parent.Name & "!" & result.Offset(, x).Address
c13 = result.Offset(0, 13).Value
c14 = result.Offset(0, 14).Value
result.Offset(0, 12).Value = tb_12
result.Offset(0, 13).Value = tb_12 + c13
result.Offset(0, 14).Value = c14 + tb_12
End If
End Sub
Private Sub UserForm_Initialize()
Dim R As Range
Set SearchRange = ThisWorkbook.Names("SearchRange").RefersToRange
bSkipEvents = True
For Each R In SearchRange
ComboBox1.AddItem R.Text
Next
bSkipEvents = False
End Sub