Vor einiger Zeit bekam ich hier im Forum sehr gute Tipps zum selektieren eines Spaltenbereiches der im Formular automatisch mit aktuellem Datum oben angefügt wird.Dazu muß per Hand der Bereich ausgewählt werden.Dannach wird ein Button gedrückt,der das Makro ausführt.
Jetzt meine Frage:
Geht das auch automatisch z.B. wenn das Arbeitsblatt geöffnet wird ?
Hier das Makro
Sub neuerTag()
Dim lz, z, c As Long
a = Selection.Rows.Count
b = Selection.End(xlUp).Row
lz = Cells(Rows.Count, 1).End(xlUp).Row
Range(Cells(b, 1), Cells(lz, 2)).Cut Destination:=Cells(b + a, 1)
ActiveCell.Offset(a, 0).Select
ActiveCell.Range(Cells(1, 1), Cells(a, 1)).Copy Cells(b, 1)
z = Selection.End(xlUp).Row
For c = z To z + a - 1
Cells(c, 2) = Date
Next c
End Sub
Für eure Antworten schon mal vielen Dank
Gruß Seadog2000