Anzeige
Anzeige
HERBERS
Excel-Forum (Archiv)
20+ Jahre Excel-Kompetenz: Von Anwendern, für Anwender
Anzeige
Inhaltsverzeichnis

Markierung weg

Forumthread: Markierung weg

Markierung weg
07.04.2006 21:34:09
Philipp
Hi Leute,
Habe folgenden Code, der funktioniert. Er macht um alle Zellen wieder einen schwarzen Rahmen. Nachdem er durchgelaufen ist, bleibt aber das die ganze Tabelle markiert. Wie kann ich diese Markierung abschalten.
Call NEW_ROW_MAX
COL_MAX = Worksheets(sheetname).UsedRange.Columns.Count
Range(Cells(1, 1), Cells(NEW_ROW_MAX, COL_MAX)).Select
Application.CommandBars("Borders").Visible = False
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 1
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 1
End With
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 1
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 1
End With
With Selection.Borders(xlInsideVertical)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 1
End With
With Selection.Borders(xlInsideHorizontal)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 1
End With
Application.ScreenUpdating = False
Danke
Philipp
Anzeige

2
Beiträge zum Forumthread
Beiträge zu diesem Forumthread

Betreff
Datum
Anwender
Anzeige
AW: Markierung weg
07.04.2006 22:06:27
ChrisL
Hallo Philipp
Beispiel-Code. Siehe auch: https://www.herber.de/xlfaq/xlbasics/main_sel.htm
Gruss
Chris

Sub t()
With Range(Cells(1, 1), Cells(3, 5))
.Borders(xlDiagonalDown).LineStyle = xlNone
.Borders(xlDiagonalUp).LineStyle = xlNone
With .Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 1
End With
With .Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 1
End With
With .Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 1
End With
With .Borders(xlEdgeRight)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 1
End With
With .Borders(xlInsideVertical)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 1
End With
With .Borders(xlInsideHorizontal)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 1
End With
End With
End Sub

Anzeige
AW: Markierung weg
07.04.2006 22:43:08
PeterW
Hallo Chris,
das kannst du einfacher haben:

Sub Rahmen()
With Range(Cells(1, 1), Cells(3, 5)).Borders
.ColorIndex = 1
.LineStyle = xlContinuous
.Weight = xlThin
End With
End Sub

Gruß
Peter
Anzeige
Anzeige
Live-Forum - Die aktuellen Beiträge
Datum
Titel
14.05.2026 13:31:09
14.05.2026 09:50:42
13.05.2026 19:14:18