VBA zur Formatierung
17.08.2016 10:45:18
Max
leider bin ich mit vbas noch nicht so affin, weshalb ich folgendes aufgezeichnet habe. Es funktioniert einwandfrei, dauert nur etwas und lässt den Bildschirm zudem etwas hin und her blitzen/wackeln.
Hat jemand eine schönere bzw. vereinfachte Version.
Vielen Dank schonmal und Grüße
VBA:
Range("V18:V2071").Select
Selection.Copy
Range("W18:AG2071").Select
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Range("X18:AG18").Select
Application.CutCopyMode = False
Selection.AutoFill Destination:=Range("X18:AG2071"), Type:=xlFillValues
Range("AA19:AB2071").Select
Selection.Style = "Comma"
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = True
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
Range("AC19:AD2071").Select
Selection.Style = "Percent"
Selection.NumberFormat = "0.0%"
Selection.NumberFormat = "0.00%"
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = True
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
Columns("V:V").Select
With Selection
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
End With
With Selection
.WrapText = True
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
End With
Columns("W:W").Select
With Selection.Interior
.Pattern = xlNone
.TintAndShade = 0
.PatternTintAndShade = 0
End With
Range("X19").Select
Anzeige