Bedingte Formatierung per VBA mit Schleife
25.09.2019 15:09:59
Dirk
Hallo Zusammen,
ich arbeite derzeit an eine Urlaubsliste (Excel 2010) und möchte per VBA eine bedingte Formatierung realisieren die 1 Halbjahr, als ca. 180 Einträge auf einen Schlag formatiert :
Dies für eine Spalte :
Sub Makro2()
' Makro2 Makro
Range("H2:H21").Select
Selection.FormatConditions.Add Type:=xlExpression, Formula1:="=$H$2=""So"""
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 65535
.TintAndShade = 0
End With
Selection.FormatConditions(1).StopIfTrue = False
End Sub
Ich würde nun gerne eine Schleife hinzufügen, welche diese Formatierung um eine Spalte verschiebt (addiert) und dann anwendet, bis 180 Spalten (von Spalte H bis Spalte GG) abgearbeitet sind.
Für eure Hilfe im Vorfeld schon mal herzlichen Dank....