Excel Spalten Farblich markieren über Powershell

  • PowerShell

    Excel Spalten Farblich markieren über Powershell

    Hallo Leute schon mal danke für eure Zeit,

    Ein weit Problem ist das ich gerne alles von 100% in grün will was klappt, aber leider nicht bei 0-49% in Rot und 50-99% in Gelb oder Orange wo ich noch den Code raussuchen muss.

    # Format Conditions hinzufügen
    $condition = $ws.Range("P : P").FormatConditions.Add(1, 3, "100")
    $condition.Interior.Color = 65280 # Grün
    $condition = $ws.Range("P : P").FormatConditions.Add(1, 3, "0-49")
    $condition.Interior.Color = 255 # Rot
    $condition = $ws.Range("P : P").FormatConditions.Add(1, 3, "50-99")
    $condition.Interior.Color = ......... #Gelb oder Orange

    ich hoffe das ihr mir helfen könnt.