ich möchte einige Zeilen mit einer bedingten Formatierung versehen.
Mit dem Recorder sieht das so aus:
Sub format()
Range("F8").Select
Selection.FormatConditions.Add Type:=xlExpression, Formula1:="=UND($D$8F7-1)"
Selection.FormatConditions(1).Interior.ColorIndex = 15
Selection.AutoFill Destination:=Range("F8:GV8"), Type:=xlFillDefault
Range("F9:GV9").Select
Range("F10").Select
Range("F9").Select
Selection.FormatConditions.Add Type:=xlExpression, Formula1:="=UND($D$9F7-1)"
Selection.FormatConditions(1).Interior.ColorIndex = 15
Selection.AutoFill Destination:=Range("F9:GV9"), Type:=xlFillDefault
Range("F9:GV9").Select
Range("F10").Select
Selection.FormatConditions.Add Type:=xlExpression, Formula1:="=UND($D$10F7-1)"
Selection.FormatConditions(1).Interior.ColorIndex = 15
Selection.AutoFill Destination:=Range("F10:GV10"), Type:=xlFillDefault
Range("F10:GV10").Select
Range("F11").Select
Selection.FormatConditions.Add Type:=xlExpression, Formula1:="=UND($D$11F7-1)"
Selection.FormatConditions(1).Interior.ColorIndex = 15
Selection.AutoFill Destination:=Range("F11:GV11"), Type:=xlFillDefault
Range("F11:GV11").Select
Range("F12").Select
End Sub
Da ich die Formatierung aber über ca. 100 Zeilen benötige, wird das ja ein mächtiges Makro. Es gibt sicherlich eine elegantere Lösung.
Kann mir da bitte jemand weiter helfen?
Vielen Dank für die Hilfe
Gisela