Live-Forum - Die aktuellen Beiträge
Datum
Titel
28.03.2024 21:12:36
28.03.2024 18:31:49
Anzeige
Archiv - Navigation
292to296
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
292to296
292to296
Aktuelles Verzeichnis
Verzeichnis Index
Verzeichnis Index
Übersicht Verzeichnisse
Inhaltsverzeichnis

ohne select

ohne select
14.08.2003 21:08:16
Peter
schönen guten abend,
mich nervt, leicht bis mittelschwer, das ewige Select.
Geht es in folgendem Beispiel auch ohne die dauernde
Selectiererei .....

Sub Linie_aus()
Range("AP8:BD12,AP14:BD19").Select
Selection.Borders(xlEdgeLeft).LineStyle = xlNone
Selection.Borders(xlEdgeTop).LineStyle = xlNone
Selection.Borders(xlEdgeBottom).LineStyle = xlNone
Selection.Borders(xlEdgeRight).LineStyle = xlNone
Range("AP14:BD19").Select
Selection.Borders(xlEdgeLeft).LineStyle = xlNone
Selection.Borders(xlEdgeTop).LineStyle = xlNone
Selection.Borders(xlEdgeBottom).LineStyle = xlNone
Selection.Borders(xlEdgeRight).LineStyle = xlNone
Range("A1").Select
End Sub


Sub Linie_ein()
Range("AP8:BD12,AP14:BD19").Select
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 2
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 2
End With
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 2
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 2
End With
Range("A1").Select
Gruß Peter

                    

5
Beiträge zum Forumthread
Beiträge zu diesem Forumthread

Betreff
Datum
Anwender
Anzeige
AW: ohne select
14.08.2003 21:18:49
Franz W.
Hallo PEter,
probiers mal so, nicht getestet:

Sub Linie_aus()
With Range("AP8:BD12,AP14:BD19")
.Borders(xlEdgeLeft).LineStyle = xlNone
.Borders(xlEdgeTop).LineStyle = xlNone
.Borders(xlEdgeBottom).LineStyle = xlNone
.Borders(xlEdgeRight).LineStyle = xlNone
End With
With Range("AP14:BD19")
.Borders(xlEdgeLeft).LineStyle = xlNone
.Borders(xlEdgeTop).LineStyle = xlNone
.Borders(xlEdgeBottom).LineStyle = xlNone
.Borders(xlEdgeRight).LineStyle = xlNone
End With
Range("A1").Select
End Sub


Sub Linie_ein()
With Range("AP8:BD12,AP14:BD19")
.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 2
End With
With Range("AP8:BD12,AP14:BD19")
.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 2
End With
With Range("AP8:BD12,AP14:BD19")
.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 2
End With
With Range("AP8:BD12,AP14:BD19")
.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 2
End With
Range("A1").Select
Grüße
Franz

Anzeige
Nimm das von Ramses, meins hat Fehler :-(( o.t.
14.08.2003 21:26:25
Franz W.
AW: ohne select
14.08.2003 21:31:58
Peter
Hallo Franz - Hallo Ramses
der Makro von Ramses klappt
Danke !

Danke fürs Feedback :-) o.T.
15.08.2003 00:04:03
Ramses
...

AW: ohne select
14.08.2003 21:22:57
Ramses
Hallo
klar geht das :-)

Option Explicit
Sub Linie_ein()
With Range("AP8:BD12,AP14:BD19").Borders(xlEdgeLeft)
    .LineStyle = xlContinuous
    .Weight = xlThin
    .ColorIndex = 2
End With
With Range("AP8:BD12,AP14:BD19").Borders(xlEdgeTop)
    .LineStyle = xlContinuous
    .Weight = xlThin
    .ColorIndex = 2
End With
With Range("AP8:BD12,AP14:BD19").Borders(xlEdgeBottom)
    .LineStyle = xlContinuous
    .Weight = xlThin
    .ColorIndex = 2
End With
With Range("AP8:BD12,AP14:BD19").Borders(xlEdgeRight)
    .LineStyle = xlContinuous
    .Weight = xlThin
    .ColorIndex = 2
End With
End Sub 
     Code eingefügt mit Syntaxhighlighter 1.16


Den Rest für Linie_Aus kannst du daraus ja ableiten.
Gruss Rainer

Anzeige

Beliebteste Forumthreads (12 Monate)

Anzeige

Beliebteste Forumthreads (12 Monate)

Anzeige
Anzeige
Anzeige