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

Rahmen setzen

Rahmen setzen
23.05.2005 09:55:12
Marco
Hallo zusammen,
ich möchte gerne per Makro automatisch einen Rahmen setzen und bestimmte Zellen Gelb färben:
1. Rahmen: Zeile 1 - Letzte in Spalte A gefüllte Zeile + 2 Zeilen
2. Gelbfärbung des Bereichs G bis M der letzten Zeile (color-index 6)
Irgendwie stehe ich auf der Leitung...
Vielen Dank
Grüsse
Marco

4
Beiträge zum Forumthread
Beiträge zu diesem Forumthread

Betreff
Datum
Anwender
Anzeige
AW: Rahmen setzen
23.05.2005 11:26:04
Harald
Moin Marco
probier mal.

Sub rahmen()
i = Cells(Rows.Count, 1).End(xlUp).Row
Range(Cells(i, 1), Cells(i + 2, 1)).Select
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
End With
Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
End Sub


Sub farb()
For e = 7 To 13
a = Cells(Rows.Count, e).End(xlUp).Row
Cells(a, e).Interior.ColorIndex = 6
Next e
End Sub

Gruß
Harald
Anzeige
AW: Rahmen setzen
23.05.2005 12:12:38
Marco
Hallo Harald,
es funzt fast alles, ausser die Rahmensetzung:
Ich hatte mich falsch ausgedrückt:
Ab Zeile 13 (inklusive) sollen alle Zellen bis hin zur letzten Zeile + 2 zusätzliche Zeilen und rechts bis rüber zur letzten Spalte einen Rahmen bekommen.
Grüsse und vielen dank
Marco
AW: Rahmen setzen
23.05.2005 12:33:57
Harald
Aus dem Handgelenk.
Hoffe es paßt ;-))

Sub rahmen()
i = Cells(Rows.Count, 1).End(xlUp).Row
col = Cells(1, Columns.Count).End(xlToLeft).Column
Range(Cells(13, 1), Cells(i + 2, col)).Select
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
End With
Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
End Sub

Gruß
Harald
Anzeige
AW: Rahmen setzen
23.05.2005 11:27:31
u_
Hallo,

Sub Rahmenundgelb()
Dim i As Long
i = Range("A65536").End(xlUp).Row
With Range(Cells(1, 1), Cells(i + 2, 1)).Border
.LineStyle = xlContinuous
.Weight = xlThin
End With
Range(Cells(i, 7), Cells(i, 13)).Interior.ColorIndex = 6
End Sub


Sub Rahmenundgelb2()
Dim i As Long
i = Range("A65536").End(xlUp).Row
Range(Cells(1, 1), Cells(i + 2, 1)).BorderAround _
LineStyle:=xlContinuous, Weight:=xlThin
Range(Cells(i, 7), Cells(i, 13)).Interior.ColorIndex = 6
End Sub

Gruß
Geist ist geil!
Anzeige

Beliebteste Forumthreads (12 Monate)

Anzeige

Beliebteste Forumthreads (12 Monate)

Anzeige
Anzeige
Anzeige