Mehrere Zellen-Auswahl, nicht reichen
Ich will eine Schleife über jede Zeile, und führen Sie einige Aktionen für mehrere Zellen ausgewählt, z.B. K3,N3,Q3,T3,W3,Z3
nächsten K4,N4,Q4...
etc.
Was mache ich falsch?
Sub Colors_test()
For counter = 3 To 110
Range("K" & counter, "N" & counter, "Q" & counter, "T" & _
counter, "W" & counter, "Z" & counter).Select
Selection.FormatConditions.AddColorScale ColorScaleType:=3
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
Selection.FormatConditions(1).ColorScaleCriteria(1).Type = _
xlConditionValueLowestValue
With Selection.FormatConditions(1).ColorScaleCriteria(1).FormatColor
.Color = 7039480
.TintAndShade = 0
End With
Selection.FormatConditions(1).ColorScaleCriteria(2).Type = _
xlConditionValuePercentile
Selection.FormatConditions(1).ColorScaleCriteria(2).Value = 50
With Selection.FormatConditions(1).ColorScaleCriteria(2).FormatColor
.Color = 8711167
.TintAndShade = 0
End With
Selection.FormatConditions(1).ColorScaleCriteria(3).Type = _
xlConditionValueHighestValue
With Selection.FormatConditions(1).ColorScaleCriteria(3).FormatColor
.Color = 8109667
.TintAndShade = 0
End With
Next counter
MsgBox "Ok All " & counter
End Sub
Was ist das problem? Bitte zitiere die Fehlermeldung.
InformationsquelleAutor blademyc | 2013-03-22
Du musst angemeldet sein, um einen Kommentar abzugeben.
Müssen Sie gehen in den Bereich wie 1 argument. Versuchen Sie dies:
InformationsquelleAutor PeteGO
Gibt es keine Notwendigkeit, um eine Schleife. Sie können den untenstehenden code.
Dank
InformationsquelleAutor