Live-Forum - Die aktuellen Beiträge
Anzeige
Archiv - Navigation
424to428
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
424to428
424to428
Aktuelles Verzeichnis
Verzeichnis Index
Verzeichnis Index
Übersicht Verzeichnisse
Inhaltsverzeichnis

Range als Spaltennummer

Range als Spaltennummer
09.05.2004 15:56:36
Peter
Hallo Excel Experten,
Ich bin im Augenblick ein wenig blind, wer hilft mir!?
Ich möchte in Zeile 1 Spalten A – O mit einem Rahmen unten und rechts versehen.
Meine Makro Aufzeichnung bringt mich nicht recht weiter, insbesondere, weil ich das natürlich als Schleife abhandeln möchte.
Für einen guten Hinweis vielen Dank im voraus.
Gruß und einen schönen Sonntag, Peter

6
Beiträge zum Forumthread
Beiträge zu diesem Forumthread

Betreff
Datum
Anwender
Anzeige
AW: Nachtrag
09.05.2004 16:12:23
Peter
so geht es, aber ist das nicht chaotisch?
Wer verkürzt mir das sinnvoll?


For intIndx = 1 To 15
      Range(Chr(intIndx + 64) & 1).Select
      Selection.Borders(xlDiagonalDown).LineStyle = xlNone
      Selection.Borders(xlDiagonalUp).LineStyle = xlNone
      With Selection.Borders(xlEdgeLeft)
         .LineStyle = xlContinuous
         .Weight = xlThin
         .ColorIndex = xlAutomatic
      End With
      Selection.Borders(xlEdgeTop).LineStyle = xlNone
      With Selection.Borders(xlEdgeBottom)
         .LineStyle = xlContinuous
         .Weight = xlThin
         .ColorIndex = xlAutomatic
      End With
      Selection.Borders(xlEdgeRight).LineStyle = xlNone
      Selection.Borders(xlDiagonalDown).LineStyle = xlNone
      Selection.Borders(xlDiagonalUp).LineStyle = xlNone
      With Selection.Borders(xlEdgeLeft)
         .LineStyle = xlContinuous
         .Weight = xlThin
         .ColorIndex = xlAutomatic
      End With
      Selection.Borders(xlEdgeTop).LineStyle = xlNone
      With Selection.Borders(xlEdgeBottom)
         .LineStyle = xlContinuous
         .Weight = xlThin
         .ColorIndex = xlAutomatic
      End With
      With Selection.Borders(xlEdgeRight)
         .LineStyle = xlContinuous
         .Weight = xlThin
         .ColorIndex = xlAutomatic
      End With
   Next intIndx


Gruß, Peter
Anzeige
AW: Nachtrag
09.05.2004 16:20:42
Franz
Hallo Peter
code muß nicht wiederholt werden

Sub test()
For intIndx = 1 To 15
With Range(Chr(intIndx + 64) & 1)
.Borders(xlDiagonalDown).LineStyle = xlNone
.Borders(xlEdgeRight).LineStyle = xlNone
.Borders(xlDiagonalUp).LineStyle = xlNone
.Borders(xlEdgeTop).LineStyle = xlNone
With .Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With .Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With .Borders(xlEdgeRight)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
End With
Next intIndx
End Sub

Gruß Franz
Anzeige
AW: Nachtrag
PeterW
Hallo Franz,
wenn wir schon beim Vereinfachen sind schau dir das mal an:

Sub test()
With Range(Cells(1, 1), Cells(1, 15))
.Borders(xlDiagonalDown).LineStyle = xlNone
.Borders(xlEdgeRight).LineStyle = xlNone
.Borders(xlDiagonalUp).LineStyle = xlNone
.Borders(xlEdgeTop).LineStyle = xlNone
.Borders(xlEdgeLeft).LineStyle = xlContinuous
.Borders(xlEdgeBottom).LineStyle = xlContinuous
.Borders(xlEdgeRight).LineStyle = xlContinuous
.Borders(xlInsideVertical).LineStyle = xlContinuous
End With
End Sub

Gruß
Peter
AW: Nachtrag
09.05.2004 17:00:18
Franz
Hallo Peter
ich wollte nicht testen und mir nicht klar ab er bei der Farbe und der Strichbreite wieder die automatischen Einstellungen benutzt oder die vom letzten Einsatz.
Danke für den Tip.
Gruß Franz
Anzeige
Range als Spaltennummer
Wolfgang
Hallo Peter
Zur info (Cells (1.Zeile , 1.Spalte) , Cells(1.Zeile , 15.Spalte)
Range(Cells(1, 1), Cells(1, 15)).Select
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
Selection.Borders(xlEdgeTop).LineStyle = xlNone
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
Wolfgang
Anzeige
AW: Franz, PeterW, Wolfgang
09.05.2004 18:19:13
Peter
Hallo Franz, PeterW, und Wolfgang,
danke für eure Anteilnahme an meinem 'Problem'.
PeterW s Version gefällt mit natürlich am besten.
Die Variante With Range(Cells(1, 1), Cells(1, 15)) kannte ich nicht, sie ist aber sehr effektiv.
Gruß, Peter

Beliebteste Forumthreads (12 Monate)

Anzeige

Beliebteste Forumthreads (12 Monate)

Anzeige
Anzeige
Anzeige