Peter Schuerer
2013-09-24 22:03:32 UTC
Hallo Zusammen (Claus ;-)),
per Makro (aufgezeichnet) formatiere ich eine Tabelle mit Rahmen:
Sub DBProd_sortieren()
'
' DBProd_sortieren Makro
' Datenbank Produktion wird nach Datum sortiert
' und Rahmen gesetzt
'
Range("A2").Select
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Sort Key1:=Range("A3"), Order1:=xlAscending,
Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
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
With Selection.Borders(xlInsideVertical)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlInsideHorizontal)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
Funktioniert auch und ist sogar (trotz Select) schnell.
In Spalte A steht das Datum im Format "TT.MM.JJJJ" und ich möchte
zwischen den unterschiedlichen Tagen einen Rahmen "xlMedium".
Aber ich bekomme es nicht hin.
Bitte um Hilfe und Lösungsvorschlag.
Danke und Gruß
Peter
per Makro (aufgezeichnet) formatiere ich eine Tabelle mit Rahmen:
Sub DBProd_sortieren()
'
' DBProd_sortieren Makro
' Datenbank Produktion wird nach Datum sortiert
' und Rahmen gesetzt
'
Range("A2").Select
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Sort Key1:=Range("A3"), Order1:=xlAscending,
Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
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
With Selection.Borders(xlInsideVertical)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlInsideHorizontal)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
Funktioniert auch und ist sogar (trotz Select) schnell.
In Spalte A steht das Datum im Format "TT.MM.JJJJ" und ich möchte
zwischen den unterschiedlichen Tagen einen Rahmen "xlMedium".
Aber ich bekomme es nicht hin.
Bitte um Hilfe und Lösungsvorschlag.
Danke und Gruß
Peter