Live-Forum - Die aktuellen Beiträge
Anzeige
Archiv - Navigation
752to756
Aktuelles Verzeichnis
Verzeichnis Index
Übersicht Verzeichnisse
Vorheriger Thread
Rückwärts Blättern
Nächster Thread
Vorwärts blättern
Anzeige
HERBERS
Excel-Forum (Archiv)
20+ Jahre Excel-Kompetenz: Von Anwendern, für Anwender
752to756
752to756
Aktuelles Verzeichnis
Verzeichnis Index
Verzeichnis Index
Übersicht Verzeichnisse
Inhaltsverzeichnis

Markierung weg

Markierung weg
07.04.2006 19: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

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

Betreff
Datum
Anwender
Anzeige
AW: Markierung weg
07.04.2006 20: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 20: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

Beliebteste Forumthreads (12 Monate)

Anzeige

Beliebteste Forumthreads (12 Monate)

Anzeige
Anzeige
Anzeige