Raja
-
Modifié par jordane45 le 27/11/2014 à 13:37
NHenry
Messages postés15113Date d'inscriptionvendredi 14 mars 2003StatutModérateurDernière intervention22 avril 2024
-
28 nov. 2014 à 12:22
Bonjour,
je tente de placer un range selon plusieurs critères. mon tableau dans lequel mon range doit etre placé est bleu. son range est de 5 soit en x ou y par un inputbox type 8.
With F1
.Cells.Clear
.Range("A:XFD").ColumnWidth = 5
.Range("A:XFD").RowHeight = 25
.Range("B2:K11").Borders.LineStyle = xlContinuous
.Range("M2:V11").Borders.LineStyle = xlContinuous
.Range("A:XFD").Interior.Color = vbWhite
.Range("B2:K11").Interior.Color = vbBlue
Set porte_avion = Application.InputBox("Choisir 5 cellules ou placer le porte-avion", "Porte-avion", Type:=8)
Do Until porte_avion.Rows.Count = 5 Or porte_avion.Columns.Count = 5 Or porte_avion.Interior.Color = vbBlue
porte_avion.Clear
.Range("B2:K11").Interior.Color = vbBlue
.Range("B2:K11").Borders.LineStyle = xlContinuous
.Range("M2:V11").Borders.LineStyle = xlContinuous
Set porte_avion = Application.InputBox("Choisir 5 cellules ou placer le porte-avion", "Porte-avion", Type:=8)
Loop
porte_avion.Interior.Color = 65535
End With
Mais ma boucle ne fonctionne pas , quelqu'un peut m'expliquer? Merci! J'ai pourtant choisi la couleur après la boucle.