Bonjour,
J'ai créé un document VBA . J'ai insérer ce code pour les codes postaux et les villes
Private Sub TextBox_CP_Change()
If Len(Me.TextBox_CP.Value) < 5 Then Exit Sub
Me.COMBO_VILLE = ""
With Me.COMBO_VILLE
.Clear
For Each Cel In Sheets("CP").Columns(1).SpecialCells(xlCellTypeConstants)
If Me.TextBox_CP.Value = Format(Cel.Value, "00000") Then .AddItem Cel.Offset(0, 1).Value
Next
.SetFocus
.DropDown
End With
End Sub
Private Sub COMBO_VILLE_Change()
For Each Cel In Sheets("CP").Columns(2).SpecialCells(xlCellTypeConstants)
If Me.TextBox_CP.Value <> "" Then
If UCase(Cel) = UCase(Me.COMBO_VILLE) And Cel.Offset(0, -1) = Me.TextBox_CP And Cel.Row > 1 Then
Me.COMBO_VILLE = Format(Cel.Value, "00000")
Me.TextBox_CP = Format(Cel.Offset(0, -1), "00000")
Exit Sub
End If
Next
End Sub
J'ai des messages d'erreur sur le format. quelqu'un peut m'aider?
Autre message d'erreur sur des textbox que je souhaite en majuscules
'Private Sub TextBox93_Change()
'TextBox93.Value = UCase(TextBox93.Value)
'End Sub
refus de reconnaître ce code
Je vous remercie de votre aide
J'ai créé un document VBA . J'ai insérer ce code pour les codes postaux et les villes
Private Sub TextBox_CP_Change()
If Len(Me.TextBox_CP.Value) < 5 Then Exit Sub
Me.COMBO_VILLE = ""
With Me.COMBO_VILLE
.Clear
For Each Cel In Sheets("CP").Columns(1).SpecialCells(xlCellTypeConstants)
If Me.TextBox_CP.Value = Format(Cel.Value, "00000") Then .AddItem Cel.Offset(0, 1).Value
Next
.SetFocus
.DropDown
End With
End Sub
Private Sub COMBO_VILLE_Change()
For Each Cel In Sheets("CP").Columns(2).SpecialCells(xlCellTypeConstants)
If Me.TextBox_CP.Value <> "" Then
If UCase(Cel) = UCase(Me.COMBO_VILLE) And Cel.Offset(0, -1) = Me.TextBox_CP And Cel.Row > 1 Then
Me.COMBO_VILLE = Format(Cel.Value, "00000")
Me.TextBox_CP = Format(Cel.Offset(0, -1), "00000")
Exit Sub
End If
Next
End Sub
J'ai des messages d'erreur sur le format. quelqu'un peut m'aider?
Autre message d'erreur sur des textbox que je souhaite en majuscules
'Private Sub TextBox93_Change()
'TextBox93.Value = UCase(TextBox93.Value)
'End Sub
refus de reconnaître ce code
Je vous remercie de votre aide