Datumsformat für Cells
Lang
in der nachfolgenden Prozedur möchte ich die Formate Datum und Uhrzeit über VBA auf jeden Fall richtig darstellen. So wie sie jetzt geschrieben ist erfolgt dies allerdings mit 'Format' nur für die Uhrzeit. Sobald ich das Uhr-Format-Muster für das Datum anpasse, wird das Datum falsch dargestellt.
Sub Zustimmung()
Dim strTemp As String
Dim ws As Worksheet
'Legende:
'>> B7 = Teilnehmer
'>> C7 = Datum mit Format TT.MM.JJJJ
'>> D7 = Uhrzeit
Set ws = Sheets("Tabelle1")
With ws
.Unprotect
If ws.Cells(7, 2) "" _
And ws.Cells(7, 3) "" Then
'so Datum und Uhrzeit ok
' strTemp = strTem & "Die Zustimmung erfolgte von > " & ws.Cells(7, 2) & " Max Mustermann " _
& ws.Cells(7, 2) & " Max Mustermann TT40032,MM.JJJJ um 12:20 Uhr
End If
End With
ActiveCell.Value = strTemp
End Sub
Vielen Dank schon mal vorab!Gruß Klaus