wie kann ich in VBA ein STRING in DATE Format umwandeln?
zum Beispiel: "7 Juni 2007" in normales Datum 07.06.2007.
Ich freue mich über jede Hilfe!
Danke!
Anja
Sub anja()
Const STRDAT As String = "7 Juni 2007"
Dim strAsDate As Date
strAsDate = DateValue(STRDAT)
MsgBox strAsDate
End Sub
Grüße Boris
A | B | C | |
2 | 10.11.2007 | 10.11.2007 | |
3 | 12.12.2007 | ||
4 | 21.12.2007 |
Formeln der Tabelle | ||||
|
Option Explicit
Public Sub Text_Datum()
Dim rngZelle As Range
For Each rngZelle In Selection.Cells
With rngZelle
If IsNumeric(.Text) Then
.Value = CDate(.Text)
End If
End With
Next rngZelle
End Sub
Servus