Schleife "schleift" nicht :-)
25.10.2018 12:30:51
Marco
vorweg: Ich bin in VBA nur geringfügig fitter als Google :-)))
Das folgende Makro soll in bestimmten Zellen (wenn "X") das Format ändern. Es funktioniert aber nicht:
(die erste Zeile) Zeile 100 hat ein "X" und wird korrekt eingestellt.
Zeile 101 hat auch ein "X", wird aber auf den "ELSE:" Wert eingestellt.
Weitere Einstellungen erfolgen nicht.
Danke für eure Hilfe.
Marco
Sub Makro1()
With Application
.ScreenUpdating = False
.Calculation = xlCalculationManual
End With
Sheets("Liste").Select
For i = 100 To 349
If Cells(i, 13).Value = "X" Then
Sheets("Liste").Cells(i, 3).Select
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
Selection.Font.Bold = True
Else:
With Selection
.HorizontalAlignment = xlLeft
.VerticalAlignment = xlTop
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
Selection.Font.Bold = False
End If
Next i
With Application
.ScreenUpdating = True
.Calculation = xlCalculationAutomatic
End With
End Sub