Betrifft: Zellrahmen: Begrenzung aus Zellinhalt auslesen
von: Ralf
Geschrieben am: 09.08.2012 14:37:23
Hallo Forum,
ich möchte aus zwei Zellinhalten einen Tabellenrahmen erstellen.
Ich habe mir folgenden Code aufgezeichnet und anschließend selbst ein bischen manipuliert. Die Definition des Zellbereiches ergibt einen Kompilierungsfehler.
Hier der Code:
Sub Makro1() 'Zellbereich aus Zellinhalt Tabelle 1 entnehmen, Q28 Begrenzung oben links, Q29 Begrenzung _ unten rechts Range("Worksheets("Tabelle1").Range("Q28").Value & ":" & Worksheets("Tabelle1").Range("Q29") _ .Value").Select Selection.Borders(xlDiagonalDown).LineStyle = xlNone Selection.Borders(xlDiagonalUp).LineStyle = xlNone With Selection.Borders(xlEdgeLeft) .LineStyle = xlContinuous .ColorIndex = 0 .TintAndShade = 0 .Weight = xlThin End With With Selection.Borders(xlEdgeTop) .LineStyle = xlContinuous .ColorIndex = 0 .TintAndShade = 0 .Weight = xlThin End With With Selection.Borders(xlEdgeBottom) .LineStyle = xlContinuous .ColorIndex = 0 .TintAndShade = 0 .Weight = xlThin End With With Selection.Borders(xlEdgeRight) .LineStyle = xlContinuous .ColorIndex = 0 .TintAndShade = 0 .Weight = xlThin End With With Selection.Borders(xlInsideVertical) .LineStyle = xlContinuous .ColorIndex = 0 .TintAndShade = 0 .Weight = xlThin End With With Selection.Borders(xlInsideHorizontal) .LineStyle = xlContinuous .ColorIndex = 0 .TintAndShade = 0 .Weight = xlThin End With Selection.Borders(xlDiagonalDown).LineStyle = xlNone Selection.Borders(xlDiagonalUp).LineStyle = xlNone With Selection.Borders(xlEdgeLeft) .LineStyle = xlContinuous .ColorIndex = 0 .TintAndShade = 0 .Weight = xlMedium End With With Selection.Borders(xlEdgeTop) .LineStyle = xlContinuous .ColorIndex = 0 .TintAndShade = 0 .Weight = xlMedium End With With Selection.Borders(xlEdgeBottom) .LineStyle = xlContinuous .ColorIndex = 0 .TintAndShade = 0 .Weight = xlMedium End With With Selection.Borders(xlEdgeRight) .LineStyle = xlContinuous .ColorIndex = 0 .TintAndShade = 0 .Weight = xlMedium End With With Selection.Borders(xlInsideVertical) .LineStyle = xlContinuous .ColorIndex = 0 .TintAndShade = 0 .Weight = xlThin End With With Selection.Borders(xlInsideHorizontal) .LineStyle = xlContinuous .ColorIndex = 0 .TintAndShade = 0 .Weight = xlThin End With End Sub
Betrifft: zu viele "
von: Rudi Maintaire
Geschrieben am: 09.08.2012 14:45:23
Hallo,
das erste und das letzte weg!
Range(Worksheets("Tabelle1").Range("Q28").Value & ":" & Worksheets("Tabelle1").Range("Q29") _
.Value).Select
Gruß
Rudi
Betrifft: AW: zu viele "
von: Ralf
Geschrieben am: 09.08.2012 14:50:13
Hallo Rudi,
super, vielen Dank.
Viele Grüße
Ralf