optionbutton

ccpapy

XLDnaute Impliqué
bonjour à tous
je cherche à affecter une valeur sur un ensemble de cellules à partir de bouton
un fichier joint explique mieux ma demande
merci pour votre temps passé pour moi
 

Pièces jointes

  • cel optionbuton.xlsm
    20.7 KB · Affichages: 50

ccpapy

XLDnaute Impliqué
re,
sympa merci
sauf que je bosse dessus pour adapter mon fichier et je plante lamentablement.
je n'ai pas l'habitude d'utiliser tes codes style loop et until
dans mon exemple j'ai écrit groupe pour expliquer
en fait les plages sont bien définies et ne changent pas

j'étais parti sur un code de ce style mais sans résultat


Dim Cel As Range
Dim Cel1 As Range
Set Plage = Range("A23:A27")

For Each Cel In Range("A5:A12")
For Each Cel1 In Plage
If Cel.Value = Cel1.Value Then Cel.Offset(, 2) = "OUI"
Next Cel
Next Cel1

si tu peux m'aiguiller...
merci
 

ccpapy

XLDnaute Impliqué
bonjour,
j'ai enfin réussi à avancer... en exemple j'ai bidouillé comme ça

Dim lig As Long
With Feuil1

For lig = 10 To 31

If .Range("A65") = .Cells(lig, 1) Then .Cells(lig, 2) = "OUI"
If .Range("A66") = .Cells(lig, 1) Then .Cells(lig, 2) = "OUI"
If .Range("A67") = .Cells(lig, 1) Then .Cells(lig, 2) = "OUI"
If .Range("A68") = .Cells(lig, 1) Then .Cells(lig, 2) = "OUI"
If .Range("A69") = .Cells(lig, 1) Then .Cells(lig, 2) = "OUI"
If .Range("A70") = .Cells(lig, 1) Then .Cells(lig, 2) = "OUI"
If .Range("A71") = .Cells(lig, 1) Then .Cells(lig, 2) = "OUI"

Next
End With


voilà, du coup, comment simplifier ce code qui fonctionne avec une seule ligne pour les cellules qui iraient de
A65 à la dernière ligne écrite en A ?

merci à qui me donnera la réponse et fera un code tout joli, tout propre ;)
 

Discussions similaires

Réponses
3
Affichages
223
Réponses
9
Affichages
657

Statistiques des forums

Discussions
312 243
Messages
2 086 551
Membres
103 246
dernier inscrit
blablasss