VBA parsing string to calculate
VBA de-converting a string, doing a computation, and reconverting
For a dispatch operation we grab dates and times in the format in the attached photo. Running with GMT timing.
Format is Year and date (YDDD)/(HHMM) (2026 Feb 26)/(1545z) which is the last number of the year, and the Julian date for number of days in the year has passed. The issues I’m running into trying to keep it tidy and foolproof for my other dispatchers, is finding a way to have excel parse the date time group in this format, and do a +12 hour calculation
The second set of two lines is when we have something leaving and when a subtracted time to start working on that. -3 hours 45 minutes as an example.
It’s a data entry driven process for the left column where we copy paste those entries, and I want them to auto populate in the right column
I need to avoid multiple columns, and need date and times combined and need to avoid using local times (as this would need a manual time conversion into the sheet) and standard time subtraction runs into issues when I have negative times and it doesn’t roll over. I haven’t been able to get =-/+TIME(3,45,0) breaks when I have Julian date and time separated and the HHMM rolls over it throw an error
I believe VBA or maybe python (running on Excel 365) could get me there, but I am at loss of how to deconstruct the string, have excel do the date and time conversation, and reconstruct the string in the format it was input with.
[link] [comments]
Want to read more?
Check out the full article on the original site