select plage dans boucle

E

excalibur

Guest
bonjour je recherche le code pour simplifier le code suivant .................... For Each Cell In Range("d53", [d53].End(xlDown)).SpecialCells(xlCellTypeVisible)
If Cell.Value = [j12].Value Or Cell.Value = [j13].Value _
Or Cell.Value = [j14].Value Or Cell.Value = [J15].Value Or Cell.Value = [J16].Value Then
Cell(1, 39) = 2
End If
Next j arrete a j16 l ex: autrement cela va jusqua j60 eh oui ca fait long ... je essaye de cree un plage du style if cell.value = plage mais j arrive a la declarer help me salutations
 
M

Minick

Guest
Salut,

J'ai pas testé mais ca doit etre bon

For Each Cell In Range("d53", [d53].End(xlDown)).SpecialCells(xlCellTypeVisible)
For Each Cell2 In Range("J12:J60")
If Cell.Value = Cell2.Value Then
Cell(1, 39) = 2
Exit For
End If
Next
Next

@+ Minick
 

Discussions similaires

Statistiques des forums

Discussions
312 370
Messages
2 087 692
Membres
103 641
dernier inscrit
anouarkecita2