Live-Forum - Die aktuellen Beiträge
Anzeige
Archiv - Navigation
680to684
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
680to684
680to684
Aktuelles Verzeichnis
Verzeichnis Index
Verzeichnis Index
Übersicht Verzeichnisse
Inhaltsverzeichnis

aktuelles Datum

aktuelles Datum
11.10.2005 19:16:59
Mario
Hallo,
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

3
Beiträge zum Forumthread
Beiträge zu diesem Forumthread

Betreff
Datum
Anwender
Anzeige
AW: aktuelles Datum
11.10.2005 19:34:01
chris b
Hallo wenn ich dich richtg verstanden habe dann geht das so.

Sub neu()
Rows("10:10").Select
Selection.Insert Shift:=xlDown
Range("A10").Select
ActiveCell.FormulaR1C1 = Date
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

grüße Christian
Anzeige
AW: aktuelles Datum
11.10.2005 19:35:21
Leo
Range("A10")= Date

mfg Leo
Danke für die schnelle Hilfe! owT
11.10.2005 19:54:55
Mario
...

Beliebteste Forumthreads (12 Monate)

Anzeige

Beliebteste Forumthreads (12 Monate)

Anzeige
Anzeige
Anzeige