aktuelles Datum
11.10.2005 19:16:59
Mario
ich habe folgenden Makro aufgezeichnet:
Rows("10:10").Select
Selection.Insert Shift:=xlDown
Range("A10").Select
ActiveCell.FormulaR1C1 = "=TODAY()"
Range("O10:R10").Select
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = True
.Orientation = 0
.AddIndent = False
.ShrinkToFit = False
.MergeCells = False
End With
Selection.Merge
Range("M10").Select
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
End With
Range("M10,O10:R10").Select
Range("O10").Activate
ActiveWindow.SmallScroll ToRight:=-6
Range("M10,O10:R10,B10").Select
Range("B10").Activate
Selection.NumberFormat = "General"
Range("N9").Select
Selection.AutoFill Destination:=Range("N9:N10"), Type:=xlFillDefault
Range("N9:N10").Select
Range("C10:L10").Select
Selection.NumberFormat = "h:mm"
Range("A10").Select
ActiveWindow.SmallScroll ToRight:=0
End Sub
Nun möchte ich, dass in der Spalte A immer das Tagesaktuelle Datum, nach Betätigung der Schaltfläche, der das aufgezeichnete Makro zugeordnet ist, erscheint. Funktioniert auch.
Öffne ich allerdings am nächsten Tag die Datei, so ist in der Spalte A nicht mehr das Datum von gestern sondern wieder das aktuelle Datum ohne das ich die Schaltfläche betätigt habe.
Was muss ich an dem Makro ändern?
Danke und Gruss
Mario