Modifier le code ajouter un client du classeur de PatrickToulon
bonjour a vous tous
dans le classeur de PatrickToulon qu'il m'a modifié afin de passer a une version a base de module de classe
donc son classeur fonctionne très bien ,ce code permet d'ajouter un client sur la feuille en tenant compte s'il y a où pas de "a l'attention de: dans l'inscription
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
| Case "ajoudev"
With Sheets("Feuil1")
.Range("j5:j10").ClearContents
.Range("A5").Value = Uclient.Combonom2.List(, 0)
.Range("J5").Value = Uclient.Combocivil2.Value & " " & Uclient.Combonom2.List(, 0)
.Range("J6").Value = Uclient.PRENOM2
'==================modif pour ajout à l'attention de: réussie ========================
If Uclient.ATTENTION2.Value <> "" Then
.Range("J7").Value = "à l'attention de : " & Uclient.ATTENTION2.Value
.Range("J8").Value = Uclient.ADRESSE2
.Range("J9").Value = Uclient.COMPLEMENT2
.Range("J10") = Uclient.cp2 & " " & Uclient.VILLE2
Else
.Range("J7").Value = Uclient.ADRESSE2
.Range("J8").Value = Uclient.COMPLEMENT2
.Range("J9") = Uclient.cp2 & " " & Uclient.VILLE2
End If
'=================================================================
End With |
mais je voudrais faire exactement la même chose avec "le complémentd'adresse" soit "COMPLEMENT2" afin que s'il n'y a pas de complément que la ligne Uclient.cp2 & " " & Uclient.VILLE2 puisse remonter d'une ligne, j'ai bien essayer comme dessous mais le cp et ville ne s'écrivent plus
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
| Case "ajoudev"
With Sheets("Feuil1")
.Range("j5:j10").ClearContents
.Range("A5").Value = Uclient.Combonom2.List(, 0)
.Range("J5").Value = Uclient.Combocivil2.Value & " " & Uclient.Combonom2.List(, 0)
.Range("J6").Value = Uclient.PRENOM2
'==================modif pour ajout à l'attention de: réussie ========================
If Uclient.ATTENTION2.Value <> "" Then
.Range("J7").Value = "à l'attention de : " & Uclient.ATTENTION2.Value
.Range("J8").Value = Uclient.ADRESSE2
.Range("J9").Value = Uclient.COMPLEMENT2
.Range("J10") = Uclient.cp2 & " " & Uclient.VILLE2
Else
.Range("J7").Value = Uclient.ADRESSE2
If Uclient.COMPLEMENT2.Value <> "" Then
.Range("J7").Value = Uclient.COMPLEMENT2
.Range("J8") = Uclient.cp2 & " " & Uclient.VILLE2
End If
End If
'=================================================================
End With |
merci de votre compréhension
Pascal