recorderaufnahme ohne select
06.08.2017 19:17:26
Gisela
leider reichen meine Kenntnisse nur für die Benutzung des Recorders.
Den nachfolgenden Makro - geht um benutzerdefinierte Formatierung - habe ich mit dem Recorder aufgenommen. Da ich eine ganze Reihe von benutzerdefinierten Formatierungen habe und zwischendurch auch immer wieder Zeilen gelöscht werden, habe ich diese Lösung gewählt. Sie funktioniert. Ist aber leider sehr umfangreich. Kann mir bitte jemand helfen, das ganze ohne die vielen select etc. darzustellen.
Hier die Recoderaufzeichnung
Sub Formatspalten()
Range("Q9:Q300").Select
Selection.FormatConditions.Add Type:=xlExpression, Formula1:="=Q9>0"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Font
.ColorIndex = xlAutomatic
.TintAndShade = 0
End With
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.ThemeColor = xlThemeColorDark1
.TintAndShade = -0.14996795556505
End With
Selection.FormatConditions(1).StopIfTrue = False
'spalten Q-R
Range("Q9:R300").Select
Selection.FormatConditions.Add Type:=xlExpression, Formula1:="=R9=""a"""
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Interior
.Pattern = xlNone
.TintAndShade = 0
End With
Selection.FormatConditions(1).StopIfTrue = False
'spalte R
Range("R9:R300").Select
Selection.FormatConditions.Add Type:=xlExpression, Formula1:="=R9>"""""
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.ThemeColor = xlThemeColorDark1
.TintAndShade = -0.349986266670736
End With
Selection.FormatConditions(1).StopIfTrue = False
With Selection.Font
.Name = "Marlett"
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.TintAndShade = 0
.ThemeFont = xlThemeFontNone
End With
End
Sub ()
Vielen Dank für jede Hilfe.
Liebe Grüße
Gisela