If CheckBox2.Value = True And CheckBox1.Value = False Then
ComboBox2.Enabled = True
CheckBox3.Value = True
ComboBox3.Enabled = True
For Each Sheet In Workbooks ("Firms.xls"). Worksheets
If Sheet.Name <> "1" Then
num = Workbooks ("Firms"). Worksheets (Sheet.Name). Index
ie = Workbooks ("Firms"). Worksheets (Sheet.Name). Range ("End" & num). Row
With Workbooks ("Firms"). Worksheets (Sheet.Name)
For ib =. Range ("Beg" & num). Row + 1 To ie
If. Cells (ib, 1). MergeCells = True Then
If ComboBox2.ListCount = 0 Then
ComboBox2.AddItem. Cells (ib, 1). Value
Else
flaf = 0
For k = 0 To ComboBox2.ListCount - 1
If ComboBox2.List (k) =. Cells (ib, 1). Value Then
flaf = 1
Exit For
Else
flaf = 0
End If
Next k
If flaf = 0 Then
ComboBox2.AddItem. Cells (ib, 1). Value
End If
End If
End If
Next ib
End With
End If
Next Sheet
End If
If CheckBox2.Value = False Then
ComboBox2.Enabled = False
CheckBox3.Value = False
ComboBox3.Enabled = False
ComboBox2.Clear
Exit Sub
End IfSubSub CheckBox4_Change ()
If CheckBox4.Value = True Then
TextBox2.Enabled = True
TextBox3.Enabled = True
TextBox4.Enabled = True
TextBox5.Enabled = True
Else
TextBox2.Text = ""
TextBox3.Text = ""
TextBox4.Text = ""
TextBox5.Text = ""
TextBox2.Enabled = False
TextBox3.Enabled = False
TextBox4.Enabled = False
TextBox5.Enabled = False
End IfSubSub ComboBox1_Change ()
ComboBox2.Clear
ComboBox3.Clear
If ComboBox1.Value <> "" Then
num = Workbooks ("Firms"). Worksheets (ComboBox1.Value). Index
ie = Workbooks ("Firms"). Worksheets (ComboBox1.Value). Range ("End" & num). Row
With Workbooks ("Firms"). Worksheets (ComboBox1.Value)
For ib =. Range ("Beg" & num). Row + 1 To ie
If. Cells (ib, 1). MergeCells = True Then
ComboBox2.AddItem. Cells (ib, 1). Value
End If
Next ib
End With
End IfSubSub ComboBox2_Change ()
ComboBox3.Clear
If ComboBox1.Value <> "" Then
k = 0
num = Workbooks ("Firms.xls"). Worksheets (ComboBox1.Value). Index
ie = Workbooks ("Firms.xls"). Worksheets (ComboBox1.Value). Range ("End" & num). Row
With Workbooks ("Firms.xls"). Worksheets (ComboBox1.Value)
For ib =. Range ("Beg" & num). Row + 1 To ie
If ComboBox2.Value = CStr (. Cells (ib, 1). Value) And. Cells (ib, 1). MergeCells = True Then
k =. Cells (ib, 1). Row
Exit For
End If
Next ib
k = k + 1
temp = k
Do While. Cells (k...