Live-Forum - Die aktuellen Beiträge
Datum
Titel
28.03.2024 21:12:36
28.03.2024 18:31:49
Anzeige
Archiv - Navigation
1200to1204
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
Rahmen in die nächste leere Zeile
Heinz
Hallo Leute
Habe unteres Makro das mir ab A6:L einen Rahmen setzt.
Ich möchte gerne wenn zb. in A10 ein Wert steht,das mir dann in A11:L11 der Rahmen gesetzt wird.
Also immer immer die nächste leere Zelle von A.
Könnte mir dazu bitte jemand helfen?
Gruß
Heinz
Private Sub CommandButton2_Click()
Application.ScreenUpdating = False
Range("A6:L" & Cells(Rows.Count, 1).End(xlUp).Row).Select
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlHairline
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlHairline
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlHairline
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.Weight = xlHairline
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlInsideHorizontal)
.LineStyle = xlContinuous
.Weight = xlHairline
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlInsideVertical)
.LineStyle = xlContinuous
.Weight = xlHairline
.ColorIndex = xlAutomatic
End With
Application.ScreenUpdating = True
End Sub

8
Beiträge zum Forumthread
Beiträge zu diesem Forumthread

Betreff
Benutzer
Anzeige
AW: Rahmen in die nächste leere Zeile
27.02.2011 19:42:52
Gerd
Hallo Heinz!
With Cells(Rows.Count, 1).End(xlUp).Offset(1).Resize(1, 12)
With .Borders. ..............
...................
End With
End With
Gruß Gerd
AW: Rahmen in die nächste leere Zeile
27.02.2011 19:58:42
Heinz
Hallo Gerd
So geht es bei mir leider nicht.
Was mache ich bitte falsch ?
Gruß
Heinz
Private Sub CommandButton2_Click()
Application.ScreenUpdating = False
Range("A6:L" & Cells(Rows.Count, 1).End(xlUp).Row).Select
With Cells(Rows.Count, 1).End(xlUp).Offset(1).Resize(1, 12)
With .Borders
End With
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlHairline
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlHairline
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlHairline
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.Weight = xlHairline
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlInsideHorizontal)
.LineStyle = xlContinuous
.Weight = xlHairline
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlInsideVertical)
.LineStyle = xlContinuous
.Weight = xlHairline
.ColorIndex = xlAutomatic
End With
Application.ScreenUpdating = True
End With
End Sub

Anzeige
AW: Rahmen in die nächste leere Zeile
27.02.2011 20:13:42
Gerd
Hallo Heinz,
du musst ändern, nicht ergänzen. (1. u. letzter Teil - der Rest gehört dir) :-)
Private Sub CommandButton2_Click()
With Cells(Rows.Count, 1).End(xlUp).Offset(1).Resize(1, 12)
With .Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlHairline
.ColorIndex = xlAutomatic
End With
With .Borders(xlInsideVertical)
.LineStyle = xlContinuous
.Weight = xlHairline
.ColorIndex = xlAutomatic
End With
End With
End Sub
Gruß Gerd
AW: Rahmen in die nächste leere Zeile
27.02.2011 20:15:26
Heinz
Hallo Gerd
Echt Super !!!
Recht herzlichen Dank.
Wünsche eine gute Nacht.
Gruß
Heinz
Anzeige
AW: Rahmen in die nächste leere Zeile
27.02.2011 20:17:42
hary
hallo Heinz
mal ein Versuch. Nur naechste leere zeile A bis L.

Option Explicit
Sub b()
Dim a As Long
Application.ScreenUpdating = False
a = Cells(Rows.Count, 1).End(xlUp).Row + 1
With Range("A" & a & ":L" & a)
.BorderAround Weight:=xlHairline, ColorIndex:=xlAutomatic
With Range("A" & a & ":L" & a).Borders(xlInsideVertical)
.Weight = xlHairline
.ColorIndex = xlAutomatic
End With
End With
Application.ScreenUpdating = True
End Sub

gruss hary
AW: Rahmen in die nächste leere Zeile
28.02.2011 15:20:12
Heinz
Hallo Hary
Du hast wieder einmal genau in's Schwarze getroffen.
Recht herzlichen Dank.
Gruß
Heinz
Anzeige
AW: und bedingtes Format ?
27.02.2011 19:53:34
Heinz
Hallo Matthias
und bedingtes Format ?
Natürlich würde es damit gehen.ABER es können 8.000-10.000 Zeilen werden.
Damit würde die Arbeitsmappe soooo aufgebläht.
Gruß
Heinz

321 Forumthreads zu ähnlichen Themen

Anzeige
Anzeige
Anzeige

Links zu Excel-Dialogen

Beliebteste Forumthreads (12 Monate)

Anzeige

Beliebteste Forumthreads (12 Monate)

Anzeige
Anzeige
Anzeige