ich habe eine Schaltfläche "Drucken" mit diesem Code:
Private Sub CommandButton1_Click()
Range(("A18:V") & Cells(Rows.Count, 1).End(xlUp).Rows.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
'Druck-Fenster wird aufgerufen
Application.Dialogs(xlDialogPrint).Show
End Sub
Wenn ich auf die Schaltfläche "Drucken" klicke, sollen die Zellen ab A18 bis letzte gefühlte Zellen im Bereich A18:V... mit Rahmen (siehe oben) formatiert werden.
Zur Zeit wird nur geprüft, ob der Bereich A18:A.... gefühlt ist.
Was muss ich ändern?
Danke im Voraus....
Liebe Grüße
SELMA