Sub PreTest_III()
Dim shp As Shape, c As Range, p As Range, x As Range, i%, vShps()
Set c = [C2]: c.RowHeight = 100: Set p = c.Offset(, 2): Randomize 1600
With ActiveSheet
.DrawingObjects.Delete
Set shp = .Shapes.AddShape(1, c.Left, c.Top, c.Width, c.Height)
y = Application.RandBetween(0, 8)
shp.Fill.PresetTextured Array(4, 10, 5, 22, 16, 8, 14, 19, 18)(y)
shp.Name = "test": vShps = Array(3, 15, 14, 23)
For i = 0 To 3
Set x = p(1, (i + 1) * 2)
Set shp = .Shapes.AddShape(vShps(i), x.Left, x.Top, x.Width, x.Height)
shp.Fill.ForeColor.SchemeColor = vShps(i)
Next
End With
End Sub
Sub Test_III()
'Dans cette version, le changement s'appliquera sur les shapes sélectionnées
'soit une seule, soit sélection multiple
Dim shp As Shape
With ActiveSheet
.Shapes("test").PickUp
For Each shp In ActiveWindow.Selection.ShapeRange
shp.Apply
Next
End With
End Sub