HELP!!! break this loop

igorski88

New Member
Joined
Jul 26, 2011
Messages
43
Hello,
I have two different tabs with a combo box in each I fill Both Combobox's with a list when the WorkBook opens. I am trying to link both combobox's. If combo box on Tab 1 changes then also change combo box on tab 2. This is all pretty easy but when custom text is received then that's when it creates a loop between themselves and crash. I think i need a "on loop end sub" or something rather Please help!!!! Thank in advance


TAB 1
Code:
Private Sub ComboBox9_Change()
Application.ScreenUpdating = False


Sheet2.Range("AE4").Value = ComboBox9.Text


Sheet2.ComboBox10.Text = ComboBox9.Text






With ComboBox9
    'See if the text is in the list
    If .ListIndex > -1 Then
        Sheet2.Range("AE5").Value = .List(.ListIndex, 1) 'Colomn 2
    Else
       Sheet2.Range("AE5").Value = ""  'clear out the cell becouse the text entered is Custom
    End If
End With
Application.ScreenUpdating = True


End Sub

TAB 2

Code:
Private Sub ComboBox10_Change()
Application.ScreenUpdating = False


Sheet2.Range("AE4").Value = ComboBox10.Text


Sheet4.ComboBox9.Text = ComboBox10.Text 'copy to AUTO tab


    
'See if the text is in the list
With ComboBox10
    If .ListIndex > -1 Then
        Sheet2.Range("AE5").Value = .List(.ListIndex, 1)
    Else
       Sheet2.Range("AE5").Value = ""  'clear out the cell becouse the text entered is Custom
    End If
End With
  
  
Application.ScreenUpdating = True
End Sub
 
How are you populating the comboboxes?
 
Upvote 0
How are you populating the comboboxes?

Thanks for the response!!!!!

On workbook open

Code:
Private Sub Workbook_Open()

''''''''''''''''''''''FILL COMBOBOXS'''''''''''''
'Fill the "Ship From" Combobox with 2 lists "MANUAL TOOL"
Dim i As Long
    With Sheet2.ComboBox9
        .ColumnCount = 2
        For i = 1 To 38
            .AddItem Sheet6.Range("A54:A91").Cells(i, 1).Value
            .List(.ListCount - 1, 1) = Sheet6.Range("B54:B91").Cells(i, 1).Value
        Next i
    End With
    
'Fill the "Ship to" Combobox with 2 lists
Dim p As Long
    With Sheet2.ComboBox10
        .ColumnCount = 2
        For p = 1 To 38
            .AddItem Sheet6.Range("A54:A91").Cells(p, 1).Value
            .List(.ListCount - 1, 1) = Sheet6.Range("B54:B91").Cells(p, 1).Value
        Next p
    End With






'Fill the "Ship From" Combobox with 2 lists "AUTO TOOL"
Dim s As Long
    With Sheet4.ComboBox8
        .ColumnCount = 2
        For s = 1 To 38
            .AddItem Sheet6.Range("A54:A91").Cells(s, 1).Value
            .List(.ListCount - 1, 1) = Sheet6.Range("B54:B91").Cells(s, 1).Value
        Next s
    End With
    
'Fill the "Ship to" Combobox with 2 lists
Dim t As Long
    With Sheet4.ComboBox9
        .ColumnCount = 2
        For t = 1 To 38
            .AddItem Sheet6.Range("A54:A91").Cells(t, 1).Value
            .List(.ListCount - 1, 1) = Sheet6.Range("B54:B91").Cells(t, 1).Value
        Next t
    End With
End sub
 
Upvote 0

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top