Losowanie i kolorowanie pól
Gdy:
Kompilator: Microsoft Excel
Sub makro_1()
For i = 1 To 100
For j = 1 To 100
Cells(i, j) = Rnd
Next j
Next i
For i = 1 To 100
For j = 1 To 100
If Cells(i, j) > 0.5 Then
Cells(i, j).Select
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.Color = 255
.TintAndShade = 0
.PatternTintAndShade = 0
End With
Else
Cells(i, j).Select
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.Color = 5287936
.TintAndShade = 0
.PatternTintAndShade = 0
End With
End If
Next j
Next i
End Sub