Rick@
XLDnaute Occasionnel
Re bonjour,
J'ai inserré une fonction dans mes macros mais voilà elle "bog"maintenant...
Il s'agit d'effacer le contenu d'une cellule quand le combobox1 est activé.
Comme le fichier est beaucoup trop volumineux voici la macro et en rouge l'ajout "fatale"... Merci de votre aide!
Sub Copie()
If Feuil3.ComboBox2 = "Commercial" Then
Rows("113:117").Copy Rows("94:94")
ElseIf Feuil3.ComboBox2 = "Résidentiel" Then
Rows("119:123").Copy Rows("94:94")
ElseIf Feuil3.ComboBox2 = "Recouvrement" Then
Rows("125:129").Copy Rows("94:94")
End If
If Feuil3.ComboBox2 = "Commercial" Then
Rows("148:151").Copy Rows("137:137")
ElseIf Feuil3.ComboBox2 = "Résidentiel" Then
Rows("154:157").Copy Rows("137:137")
ElseIf Feuil3.ComboBox2 = "Recouvrement" Then
Rows("160:163").Copy Rows("137:137")
End If
If Feuil3.ComboBox2 = "Commercial" Then
Rows("180:183").Copy Rows("169:169")
ElseIf Feuil3.ComboBox2 = "Résidentiel" Then
Rows("186:189").Copy Rows("169:169")
ElseIf Feuil3.ComboBox2 = "Recouvrement" Then
Rows("192:195").Copy Rows("169:169")
End If
If ComboBox3.ListIndex = -1 Then Exit Sub
On Error Resume Next
Application.Run ComboBox3
If Err.Number > 0 Then
MsgBox "Macro " & ComboBox3 & " inexistante"
End If
End Sub
Private Sub ComboBox1_Change()
Range("H12:I12").Select
Selection.ClearContentsEnd Sub
Private Sub ComboBox2_Change()
Call Copie
End Sub
Private Sub ComboBox3_Change()
Call Copie
End Sub
J'ai inserré une fonction dans mes macros mais voilà elle "bog"maintenant...
Il s'agit d'effacer le contenu d'une cellule quand le combobox1 est activé.
Comme le fichier est beaucoup trop volumineux voici la macro et en rouge l'ajout "fatale"... Merci de votre aide!
Sub Copie()
If Feuil3.ComboBox2 = "Commercial" Then
Rows("113:117").Copy Rows("94:94")
ElseIf Feuil3.ComboBox2 = "Résidentiel" Then
Rows("119:123").Copy Rows("94:94")
ElseIf Feuil3.ComboBox2 = "Recouvrement" Then
Rows("125:129").Copy Rows("94:94")
End If
If Feuil3.ComboBox2 = "Commercial" Then
Rows("148:151").Copy Rows("137:137")
ElseIf Feuil3.ComboBox2 = "Résidentiel" Then
Rows("154:157").Copy Rows("137:137")
ElseIf Feuil3.ComboBox2 = "Recouvrement" Then
Rows("160:163").Copy Rows("137:137")
End If
If Feuil3.ComboBox2 = "Commercial" Then
Rows("180:183").Copy Rows("169:169")
ElseIf Feuil3.ComboBox2 = "Résidentiel" Then
Rows("186:189").Copy Rows("169:169")
ElseIf Feuil3.ComboBox2 = "Recouvrement" Then
Rows("192:195").Copy Rows("169:169")
End If
If ComboBox3.ListIndex = -1 Then Exit Sub
On Error Resume Next
Application.Run ComboBox3
If Err.Number > 0 Then
MsgBox "Macro " & ComboBox3 & " inexistante"
End If
End Sub
Private Sub ComboBox1_Change()
Range("H12:I12").Select
Selection.ClearContentsEnd Sub
Private Sub ComboBox2_Change()
Call Copie
End Sub
Private Sub ComboBox3_Change()
Call Copie
End Sub