Ändern Sie die Farbe, die Form mit einem makro

Möchte ich ändern Sie die Farbe einer Form mit einem makro.

ActiveSheet.Shapes.Range(Array("Rectangle 20")).Select
If Selection.ShapeRange.Fill.Visible = msoFalse Then
    Selection.ShapeRange.Fill.Visible = msoTrue
    Selection.ShapeRange.Fill.ForeColor.RGB = RGB(255, 0, 0)
    Selection.ShapeRange.Fill.Transparency = 0
    Selection.ShapeRange.Fill.Solid
Else: Selection.ShapeRange.Fill.Visible = msoTrue
Selection.ShapeRange.Fill.Visible = msoFalse
End If

If Selection.ShapeRange.Fill.Visible = msoTrue Then
Selection.ShapeRange.Fill.Visible = msoFalse
Else: Selection.ShapeRange.Fill.Visible = msoFalse
    Selection.ShapeRange.Fill.Visible = msoTrue
    Selection.ShapeRange.Fill.ForeColor.RGB = RGB(255, 0, 0)
    Selection.ShapeRange.Fill.Transparency = 0
    Selection.ShapeRange.Fill.Solid
End If

Nun möchte ich, wenn es keine Füllung, es wird rot, und wenn die Füllung rot ist, ist es keine Füllung.
Kann mir jemand helfen?

InformationsquelleAutor Freek v. wely | 2015-05-06

Schreibe einen Kommentar