Einführung "VBA mit Microsoft Office"

Code Snippet "VBA Excel"

Zellen mit Zufallsfarbe formatieren

Excel hat 56 Farben in der Standardpalette.

Sub WeiterWennOK_Zusatz()
  If MsgBox("Markierte Zellen zufällig einfärben?", _
      vbOKCancel, "Formatieren") = 1 Then
    Application.Selection.Interior.ColorIndex = Int((56 * Rnd(1)) + 1)
  End If
End Sub