Darf ich Euch bitten, mir bei meiner Aufgabe zu helfen. Leider bringe ich den nächsten Schritt nicht mehr fertig.
Besten Dank im Voraus für Eure Hilfe.
Erklärung
Dieses Makra unten soll mein Excel jedem Monat richig formatieren. Im Register Steuerung gebe ich jeweils den Monat an. Jetzt habe ich 2 mal eine Quartalsberechnung. Jedoch kann ich bei der ersten Berechnung nicht noch eine Zelle dazurechnen.
Zelle AI Q1
Zelle AJ davon LP
Zelle AK Q2
Zelle AL davon LP
Zelle AM Q3
Zelle AN davon LP
Zelle AO Q4
Zelle AP davon LP
Zelle CH Q1
Zelle CI Q2
Zelle CJ Q3
Zelle CK Q4
Sub Quartal_Formatierung_Quartal_BKD()
' Makro 2b
' Mit diesem Makro werden das Register BKD richtig formatiert
Dim sSheet As Variant, iQuartal As Integer, c As Range
Dim i As Long, j As Long
Dim iOffset As Integer
iQuartal = Sheets("Steuerung").Range("B2")
Application.ScreenUpdating = False
sSheet = "Tabelle1"
For Each sSheet In Array("BKD_Quartal")
With Sheets(sSheet)
For j = 34 To 85 Step 51
For i = 1 To iQuartal - 1
With .Cells(14, j).Offset(, i).Resize(49)
.Font.Bold = False
.HorizontalAlignment = xlRight
With .Font
.ColorIndex = xlAutomatic
.TintAndShade = 0
End With
End With
Next i
With .Cells(14, j).Offset(, iQuartal).Resize(49)
.Font.Bold = True
.HorizontalAlignment = xlRight
With .Font
.ColorIndex = xlAutomatic
.TintAndShade = 0
End With
End With
For i = iQuartal + 1 To 4
With .Cells(14, j).Offset(, i).Resize(49)
.Font.Bold = False
.HorizontalAlignment = xlCenter
With .Font
.Color = -7303024
.TintAndShade = 0
.Bold = False
End With
End With
Next i
With .Cells(14, j).Offset(1, 1).Resize(48, 4)
.VerticalAlignment = xlBottom
.WrapText = True
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
With .Cells(14, j).Offset(, 1).Resize(, 4)
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
End With
Next j
End With
Next sSheet
Application.ScreenUpdating = True
MsgBox "Fertig"
End Sub
Ich hoffe meine Frage ist verständlich. Ist nicht ganz leichr dies zu erklären.Besten Dank.