Live-Forum - Die aktuellen Beiträge
Datum
Titel
24.04.2024 19:29:30
24.04.2024 18:49:56
24.04.2024 17:19:09
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 entfernen

Markierung entfernen
12.04.2006 10:28:28
Philipp
Hallo
Habe folgenden Code, der mir die farbig umrandeten Zellen wieder schwarz macht. Das macht der Code auch. Jedoch bleiben alle Zellen danach markiert. Wie kann ich das ändern? Da muss doch nur eine Option geändert werden oder? Ich weiß aber nicht welche.
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 = True
Worksheets(sheetname).Activate
Philipp

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

Betreff
Datum
Anwender
Anzeige
AW: Markierung entfernen
12.04.2006 10:50:34
Philipp
Habe selber Lösung gefunden:
Einfach zum Schluß
Range("A1").Select
Und das wars dann schon.
Philipp
AW: Markierung entfernen
12.04.2006 11:20:34
Matthias
Hallo Phillipp,
vermeide Select:

Dim rng As Range
Call NEW_ROW_MAX
COL_MAX = Worksheets(sheetname).UsedRange.Columns.Count
Set rng = Range(Cells(1, 1), Cells(NEW_ROW_MAX, COL_MAX))
Application.CommandBars("Borders").Visible = False
rng.Borders(xlDiagonalDown).LineStyle = xlNone
rng.Borders(xlDiagonalUp).LineStyle = xlNone
With rng.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 1
End With
With rng.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 1
End With
With rng.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 1
End With
With rng.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 1
End With
With rng.Borders(xlInsideVertical)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 1
End With
With rng.Borders(xlInsideHorizontal)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 1
End With
'Application.ScreenUpdating = True
Worksheets(sheetname).Activate

siehe auch:
https://www.herber.de/xlfaq/xlbasics/main_sel.htm
Gruß Matthias
Anzeige

Beliebteste Forumthreads (12 Monate)

Anzeige

Beliebteste Forumthreads (12 Monate)

Anzeige
Anzeige
Anzeige