Hello everyone, my first post here
I am writing a VBA script to automate a task. I have a column which contains both date and time in the format of (yyyy/mm/dd h:mm:ss). I have to split the date and time and send it to an outlook method.
I did the following:
inside a for each loop I get all the date and time values
For the most part this works, however 12:00:00 AM is automatically converted to 0:00 and when this is passed to the Outlook method, it crashes
I can't really change the format type because this data is coming from a sharepoint site, and its constantly refreshed.
I also set the startDateTime As Date and tried the following
But that didn't work either.
One other thing, when I click a cell in the column, the date and time values are stored as an Integer (43031.5).
I have to use this data a lot, do comparisons with it. Any help will be appreciated! thank you
I am writing a VBA script to automate a task. I have a column which contains both date and time in the format of (yyyy/mm/dd h:mm:ss). I have to split the date and time and send it to an outlook method.
I did the following:
Code:
Dim startDateTime As String
Dim startTime As String
Dim startDate As String
inside a for each loop I get all the date and time values
Code:
startDateTime = row.Columns(5)
startDate= Left(rows.Columns(5), 10)
startTime = Right(rows.Columns(5),11)
I can't really change the format type because this data is coming from a sharepoint site, and its constantly refreshed.
I also set the startDateTime As Date and tried the following
Code:
startTime = TimeSerial(startDateTime) 'Hour(startDateTime) & ":" & Minute(startDateTime) & ":" & Second(startDateTime)
But that didn't work either.
One other thing, when I click a cell in the column, the date and time values are stored as an Integer (43031.5).
I have to use this data a lot, do comparisons with it. Any help will be appreciated! thank you