Thema Datum  Von Nutzer Rating
Antwort
09.01.2023 11:06:08 Kim
NotSolved
Blau Bedingte Formatierung in Range
09.01.2023 16:23:58 UweD
***
NotSolved

Ansicht des Beitrags:
Von:
UweD
Datum:
09.01.2023 16:23:58
Views:
320
Rating: Antwort:
  Ja
Thema:
Bedingte Formatierung in Range

Hallo

versuch es mal so

Sub Formatierung()

    Dim Zelleeins As Variant
    Zelleeins = "A2"

    Dim Zellezwei As Variant
    Zellezwei = "A3"
    
    Dim RNG As Range
    
    Zelleeins = InputBox(" Zelle 1 die formatiert werden soll ", , Zelleeins)
    Debug.Print [Zelleeins]

    Zellezwei = InputBox(" Zelle 2 die formatiert werden soll ", , Zellezwei)
    Debug.Print [Zellezwei]

    Set RNG = Tabelle1.Range(Range(Zelleeins), Range(Zellezwei))
    With RNG
        With .Interior
            .Pattern = xlSolid
            .PatternColorIndex = xlAutomatic
            .Color = 65735
            .TintAndShade = 0
            .PatternTintAndShade = 0
        End With
   
        .FormatConditions.Add Type:=xlCellValue, Operator:=xlEqual, _
            Formula1:="=""C"""
        .FormatConditions(.FormatConditions.Count).SetFirstPriority
        With .FormatConditions(1).Interior
            .PatternColorIndex = xlAutomatic
            .Color = 12713983
        End With


        .FormatConditions(1).StopIfTrue = False
        .FormatConditions.Add Type:=xlCellValue, Operator:=xlEqual, _
            Formula1:="=""C1"""
        .FormatConditions(.FormatConditions.Count).SetFirstPriority
        With .FormatConditions(1).Interior
            .PatternColorIndex = xlAutomatic
            .Color = 65535
        End With


        .FormatConditions(1).StopIfTrue = False
        .FormatConditions.Add Type:=xlCellValue, Operator:=xlEqual, _
            Formula1:="=""B"""
        .FormatConditions(.FormatConditions.Count).SetFirstPriority
        With .FormatConditions(1).Interior
            .PatternColorIndex = xlAutomatic
            .Color = 255
        End With


        .FormatConditions(1).StopIfTrue = False
        .FormatConditions.Add Type:=xlCellValue, Operator:=xlEqual, _
            Formula1:="=""B1"""
        .FormatConditions(.FormatConditions.Count).SetFirstPriority
        With .FormatConditions(1).Interior
            .PatternColorIndex = xlAutomatic
            .Color = 192
        End With


        .FormatConditions(1).StopIfTrue = False
        .FormatConditions.Add Type:=xlCellValue, Operator:=xlEqual, _
            Formula1:="=""A"""
        .FormatConditions(.FormatConditions.Count).SetFirstPriority
        With .FormatConditions(1).Font
            .Bold = True
        End With
    
        With .FormatConditions(1).Interior
            .PatternColorIndex = xlAutomatic
            .Color = 192
        End With

    End With

End Sub

LG UweD


Ihre Antwort
  • Bitte beschreiben Sie Ihr Problem möglichst ausführlich. (Wichtige Info z.B.: Office Version, Betriebssystem, Wo genau kommen Sie nicht weiter)
  • Bitte helfen Sie ebenfalls wenn Ihnen geholfen werden konnte und markieren Sie Ihre Anfrage als erledigt (Klick auf Häckchen)
  • Bei Crossposting, entsprechende Links auf andere Forenbeiträge beifügen / nachtragen
  • Codeschnipsel am besten über den Code-Button im Text-Editor einfügen
  • Die Angabe der Emailadresse ist freiwillig und wird nur verwendet, um Sie bei Antworten auf Ihren Beitrag zu benachrichtigen
Thema: Name: Email:



  • Bitte beschreiben Sie Ihr Problem möglichst ausführlich. (Wichtige Info z.B.: Office Version, Betriebssystem, Wo genau kommen Sie nicht weiter)
  • Bitte helfen Sie ebenfalls wenn Ihnen geholfen werden konnte und markieren Sie Ihre Anfrage als erledigt (Klick auf Häckchen)
  • Bei Crossposting, entsprechende Links auf andere Forenbeiträge beifügen / nachtragen
  • Codeschnipsel am besten über den Code-Button im Text-Editor einfügen
  • Die Angabe der Emailadresse ist freiwillig und wird nur verwendet, um Sie bei Antworten auf Ihren Beitrag zu benachrichtigen

Thema Datum  Von Nutzer Rating
Antwort
09.01.2023 11:06:08 Kim
NotSolved
Blau Bedingte Formatierung in Range
09.01.2023 16:23:58 UweD
***
NotSolved