ich hätte gern dies:
Range("A29:H" & Cells(Rows.Count, 1).End(xlUp).Row).Select
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
so formatiert wie meine Zeile 28
Wie mache das ?
Danke im Voraus...
Liebe Grüße
SELMA
Sub Zeile28()
Range("A28:B28").Select
With Selection
.HorizontalAlignment = xlGeneral
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.ShrinkToFit = False
.MergeCells = True
End With
Range("D28:G28").Select
With Selection
.HorizontalAlignment = xlGeneral
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.ShrinkToFit = False
.MergeCells = True
End With
Range("A28:H28").Select
With Selection.Borders
.LineStyle = xlNone
End With
With Selection.Borders
.LineStyle = xlContinuous
.Weight = xlHairline
.ColorIndex = xlAutomatic
End With
End Sub
Sub Zeile28()
With Range("A28:B28", "D28:G28", "A29:H" & Cells(Rows.Count, 1).End(xlUp).Row)
.HorizontalAlignment = xlGeneral
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.ShrinkToFit = False
.MergeCells = True
End With
With Range("A28:H28").Borders
.LineStyle = xlContinuous
.Weight = xlHairline
.ColorIndex = xlAutomatic
End With
End Sub
Option Explicit
Sub Zeile28()
Dim zelle As Range
With Application.Union(Range("A28:B28"), Range("D28:G28"))
.HorizontalAlignment = xlGeneral
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.ShrinkToFit = False
.MergeCells = True
End With
With Range("A28:H28").Borders
.LineStyle = xlContinuous
.Weight = xlHairline
.ColorIndex = xlAutomatic
End With
For Each zelle In Range("A29:H" & Cells(Rows.Count, 1).End(xlUp).Row)
zelle.HorizontalAlignment = xlGeneral
zelle.VerticalAlignment = xlBottom
zelle.WrapText = False
zelle.Orientation = 0
zelle.AddIndent = False
zelle.ShrinkToFit = False
zelle.MergeCells = True
With zelle.Borders
.LineStyle = xlContinuous
.Weight = xlHairline
.ColorIndex = xlAutomatic
End With
Next zelle
End Sub
Option Explicit
Sub Zeile28()
With Range("D28:G28")
.HorizontalAlignment = xlGeneral
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.ShrinkToFit = False
.MergeCells = True
End With
With Range("A28:B28")
.HorizontalAlignment = xlGeneral
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.ShrinkToFit = False
.MergeCells = False
End With
With Range("A28:H28").Borders
.LineStyle = xlContinuous
.Weight = xlHairline
.ColorIndex = xlAutomatic
End With
Range("D28:G28").Copy
Range("D29:G" & Cells(Rows.Count, 1).End(xlUp).Row).PasteSpecial Paste:=xlFormats, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
Range("C28").Copy
Range("c29:C" & Cells(Rows.Count, 1).End(xlUp).Row).PasteSpecial Paste:=xlFormats, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
Application.CutCopyMode = False
End Sub
Gruß
Reinhard
Die erweiterte Suchfunktion hilft dir, gezielt die besten Antworten zu finden
Suche nach den besten AntwortenEntdecke unsere meistgeklickten Beiträge in der Google Suche
Top 100 Threads jetzt ansehen