Private Sub worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False
Cells(Target.Row, Target.Column) = Date & "-" & Cells(Target.Row, Target.Column)
Application.EnableEvents = True
End SubPrivate Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False
Cells(Target.Row, Target.Column).NumberFormat = "dd/mm/jjjj - hh:mm"
Cells(Target.Row, Target.Column) = Date & " - " & Cells(Target.Row, Target.Column)
Application.EnableEvents = True
End Sub
Ergebnis dann 06.06.2008 - 20:21:00Cells(Target.Row, Target.Column) = Day(Date) & "." & Month(Date) & ". - " & Cells(Target.Row, Target.Column) bringt zwar das Datum ohne Jahr, aber nur einstellig, trotz Formatzuweisung.Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False
'falls Eingabe in Spalte A
If Target.Column = 1 Then
Cells(Target.Row, 1).NumberFormat = "dd/mm/jjjj - hh:mm"
Cells(Target.Row, 1) = Date & " - " & Cells(Target.Row, 1)
End If
Application.EnableEvents = True
End SubPrivate Sub ToggleButton1_Click()
Dim TB As ToggleButton
Set TB = ToggleButton1
If TB.Value = True Then
TB.Caption = "HilfeAn"
DatumHilfeAn
Else
TB.Caption = "HilfeAus"
DatumHilfeAus
End If
End SubSub DatumHilfeAn()
Sheets("Tabelle3").Select
Cells(1, 256).Value = 1
End Sub
Sub DatumHilfeAus()
Sheets("Tabelle3").Select
Cells(1, 256).Value = 0
End SubPrivate Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False
'falls Eingabe in Spalte A
If Target.Column = 1 And Cells(1, 256).Value = 1 Then
Cells(Target.Row, 1).NumberFormat = "dd/mm/jjjj - hh:mm"
Cells(Target.Row, 1) = Date & " - " & Cells(Target.Row, 1)
End If
Application.EnableEvents = True
End SubSheets("Tabelle3").SelectHier musst Du Deinen Blattnamen eintragen.Sub DatumHilfeAn()
Sheets("Tabelle1").Cells(1, 256).Value = 1
End Sub
Sub DatumHilfeAus()
Sheets("Tabelle1").Cells(1, 256).Value = 0
End SubIf Target.Column = 1 [b]And Cells(1, 256).Value = 1[/b] Then im Change-Ereignis ergänzt (Antwort8)?Private Sub worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False
'falls SpalteA aktiv und "IV1" = 1
If Target.Column = 1 And Cells(1, 256).Value = 1 Then
'Format setzen
Cells(Target.Row, 1).NumberFormat = "d/m/ h:mm"
'aktuelles Datum zur Eingabe = Uhrzeit hinzu
Cells(Target.Row, 1) = Date & " " & Cells(Target.Row, 1)
'IV1 auf 0, um Zelle zu bestätigen
Cells(1, 256).Value = 0
'Focus zurück zur Startzelle; erforderlich, weil
'Markierung nach Eingabe nach unten verschoben wird = Standard
ActiveCell.Offset(-1, 0).Activate
'jetzt Eingabe bestätigen
SendKeys "{F2}", True
SendKeys "{ENTER}", True
'IV1 auf 1 zurückstellen
Cells(1, 256).Value = 1
End If
Application.EnableEvents = True
End SubSelection.Sort Key1:=Range("A1").......Anstatt "A1" setzt Du "B1" Selection.Sort Key1:=Range("A2"), Order1:=xlAscending, [b]Header:=xlYes[/b], _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottomWie ich sagte, die IV=1 Variante ist eine Krücke.If Target.Column = 1 Then
Selection.Sort Key1:=Range("A2"), Order1:=xlAscending, Header:=xlYes, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
End IfMich persönlich würde das Sortieren nach jedem "Enter" kirre machen: Du änderst z.B. in Zeile 210 etwas und schwupp wird alles sortiert und A210 findet man z.B. in A10, d.h. man hat kaum Gelegenheit, die Eingabe zu kontrollieren.
RPC-Server ist nicht verfügbar / Datum & Uhrzeit
Poseidon 25.01.2007 - 1445 Hits - 3 Antworten
Uhrzeit und Datum
Goliath 26.01.2007 - 84 Hits - 2 Antworten
Datum und Uhrzeit
Mustang351 22.03.2007 - 87 Hits - 3 Antworten
Falsche Uhrzeit
strahleauge 05.04.2007 - 230 Hits - 3 Antworten
Löschen einer Zeile bei Vergleich Datum/Uhrzeit
chriskuf 06.07.2007 - 56 Hits - 1 Antwort