Hi
I need your help again, I'm doing the project created two comboboxes padlocks, where one depends on the other, but this error message appearing.
time error '-2147467259 (80004005)
unspecified error
I used this code:
Code:
Private Sub ComboBox7_Change()
ComboBox7 = UCase(ComboBox7)
Call CarregaCargos(Me.ComboBox7.List(Me.ComboBox7.ListIndex))
End Sub
Code:
Private Sub UserForm_Initialize()
Call CarregaGrupos
End Sub
Code:
Private Sub CarregaGrupos()
Dim linha As Integer, coluna As Integer
linha = 2
coluna = 1
Me.ComboBox7.Clear
With Sheets("G_Cargos")
Do While Not IsEmpty(.Cells(linha, coluna))
Me.ComboBox7.AddItem .Cells(linha, coluna).Value
linha = linha + 1
Loop
End With
End Sub
Code:
Private Sub CarregaCargos(ByVal Cargos As String)
Dim linha As Integer, colunaCargos As Integer, colunaGrupos As Integer
linha = 2
colunaCargos = 1
colunaGrupos = 2
Me.ComboBox8.Clear
With Sheets("Cargos")
Do While Not IsEmpty(.Cells(linha, colunaCargos))
If .Cells(linha, colunaGrupos).Value = G_Cargos Then
Me.ComboBox8.AddItem .Cells(linha, colunaCargos).Value
End If
linha = linha + 1
Loop
End With
End Sub
My file in:
Download ErroComboBox.xlsm from Sendspace.com - send big files the easy way
Thank you!!
Bookmarks