Horje
vba string to date Code Example
vba string to date
Dim myDate As Date, strDate As String
myDate = CDate("2021-01-28")
strDate = Format(myDate, "YYYY-MM-DD")				  ' 2021-01-28
' String to date
myDate = CDate(Format$("20210213101235", "####-##-## ##:##:##"))
' Date to string
strDate = Format(myDate, "YYYY-MM-DD hh:mm:ss")       ' 2021-02-13 10:12:35
string to date vb
Dim iDate As String = "05/05/2005"
Dim oDate As DateTime = Convert.ToDateTime(iDate)
MsgBox(oDate.Day & " " & oDate.Month & "  " & oDate.Year)




3

Related
vba delete file Code Example vba delete file Code Example
write to text file vb.net Code Example write to text file vb.net Code Example
excel vba copy range with filter Code Example excel vba copy range with filter Code Example
shortcut to apply a formula to an entire column in excel Code Example shortcut to apply a formula to an entire column in excel Code Example
xlvba check for folder Code Example xlvba check for folder Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
11