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

Ansicht des Beitrags:
Von:
Kim
Datum:
09.01.2023 11:06:08
Views:
608
Rating: Antwort:
  Ja
Thema:
Bedingte Formatierung in Range

Hallo zusammen, 

ich möchte in der abgefragten Range (was funktioniert)   Zellen mit bestimmten Buchstaben anderst formatieren.   
Allerdings klappt das mit den Buchstaben noch nicht.  Es kommt "Laufzeitfehler 424  Objekt erforderlich"   an markierter Stelle

Kann mir da jemand bitte helfen ?

 

 

 

Sub Formatierung()
'
'
'

 

Dim Zelleeins As Variant
Zelleeins = "A2"

 

 

 

Dim Zellezwei As Variant
Zellezwei = "A3"

 

 

 

Zelleeins = InputBox(" Zelle 1 die formatiert werden soll ")
Debug.Print [Zelleeins]

 

 

 

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










With Tabelle1.Range(Range(Zelleeins), Range(Zellezwei)).Interior
        .Pattern = xlSolid
        .PatternColorIndex = xlAutomatic
        .Color = 65735
        .TintAndShade = 0
        .PatternTintAndShade = 0
End With

 

 

    

    Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlEqual, _
        Formula1:="=""C"""
    Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
    With Selection.FormatConditions(1).Interior
        .PatternColorIndex = xlAutomatic
        .Color = 12713983
    End With


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


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


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


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

    With Selection.FormatConditions(1).Interior
        .PatternColorIndex = xlAutomatic
        .Color = 192
    End With



End Sub


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
Rot Bedingte Formatierung in Range
09.01.2023 11:06:08 Kim
NotSolved
09.01.2023 16:23:58 UweD
***
NotSolved