Home |
Search |
Today's Posts |
#1
![]() |
|||
|
|||
![]()
Hi All,
I have a module which works in Access 97 so well that I want to see if I can re-create this to work as a new function in Excel 97. Please see the module code below: Function ConvertDate(InputValue As Variant) As Variant Dim lngDay As Long Dim lngMonth As Long Dim lngYear As Long If IsNull(InputValue) = False Then lngYear = InputValue \ 65536 lngMonth = (InputValue Mod 65536) \ 256 lngDay = InputValue - (lngYear * 65536) - (lngMonth * 256) ConvertDate = DateSerial(lngYear, lngMonth, lngDay) Else ConvertDate = Null End If End Function Can anyone help with translating this to work as an Excel Function? -- Adam ----------- Windows 98 + Office Pro 97 |
#2
![]() |
|||
|
|||
![]()
Hi
this function should work in Excel as well -- Regards Frank Kabel Frankfurt, Germany Adam wrote: Hi All, I have a module which works in Access 97 so well that I want to see if I can re-create this to work as a new function in Excel 97. Please see the module code below: Function ConvertDate(InputValue As Variant) As Variant Dim lngDay As Long Dim lngMonth As Long Dim lngYear As Long If IsNull(InputValue) = False Then lngYear = InputValue \ 65536 lngMonth = (InputValue Mod 65536) \ 256 lngDay = InputValue - (lngYear * 65536) - (lngMonth * 256) ConvertDate = DateSerial(lngYear, lngMonth, lngDay) Else ConvertDate = Null End If End Function Can anyone help with translating this to work as an Excel Function? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How to use a Access Query that as a parameter into Excel database query | Excel Discussion (Misc queries) | |||
Excel aficionado wants to learn Access | Excel Discussion (Misc queries) | |||
Excel aficionado wants to learn Access | Excel Discussion (Misc queries) | |||
Excel aficionado wants to learn Access | Excel Discussion (Misc queries) | |||
Excel user desires to learn ABC of Access | Excel Discussion (Misc queries) |