Calculations with different date formats
- From: "Derek" <dgadd@xxxxxxxxxxx>
- Date: 9 May 2005 21:07:34 -0700
Hi,
I have a date and time in a single cell in a work***, with the format
"dd/mm/yy hh:mm". I have written a function to determine what crew is
working at this particular time. However, VBA has the date format as
mm/dd/yy and this seems to give me the wrong answers. How can I force
VBA to interpret my date format correctly? The function code is as
follows:
Public Function Crew(DTS)
Dim BaseDTS, CrewShifts1, CrewShifts2
Dim ShiftsSince, LookupShift
BaseDTS = #5/2/2005# + 8 / 24 'May 2, 2005 08:00
ShiftsSince = (DTS - BaseDTS) * 2
etc etc
End Function
TIA,
Derek
.
- Follow-Ups:
- Re: Calculations with different date formats
- From: Stephen Bullen
- Re: Calculations with different date formats
- From: Niek Otten
- Re: Calculations with different date formats
- Prev by Date: Re: Application.EnableEvents = False not working
- Next by Date: Re: More Efficient code than this
- Previous by thread: Protection in VB
- Next by thread: Re: Calculations with different date formats
- Index(es):