Kann ich im Excel anhand der Zellenschatierung Summen bilden? Ich verwende ein VBA-Script mit welchem ich Zellen eine gewisse Farbe hinterlege. Nun will ich die markierten Felder Zusammenzählen und einen individuellen Text hineinschreiben. Geht das?
Hier noch mein Script:
ActiveSheet.Unprotect "?"
With Selection
.HorizontalAlignment = xlLeft
.VerticalAlignment = xlCenter
.WrapText = False
.Orientation = 0
.AddIndent = False
.ShrinkToFit = False
.MergeCells = False
End With
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
Selection.Borders(xlInsideVertical).LineStyle = xlNone
With Selection.Interior
.ColorIndex = 14
.Pattern = xlSolid
End With
ActiveSheet.Protect "?"
End Sub