Full Version: User Defined Function
UtterAccess Discussion Forums > Microsoft® Office > Microsoft Excel
engelwood
I have a function (it converts julian to an excel date code) that works great expect for two limitations.

1. It only works in my personal worksheet. It won't work in Book 1 or Book 2... etc...
2. The format comes in Excel format. I would like to have it in Gregorian Calendar date form (e.g. 3/11/2005)

Unfortunately I'm just a beginner so I'm not sure how to fix these problems. Could someone please help me?

Thanks!

Public Function Julian(s As String)
Dim yr As Integer, dt As Integer
s = Format(s, "000000")
yr = Left(s, 3) + 1900
dt = Right(s, 3)

Julian = DateSerial(yr, 1, dt)

End Function
Luceze
Hello,

You don't really need a UDF for this one. Check out Chip Pearson's site here .

A formula will be portable between workbooks and workstations. A UDF will have to be stored in an add-in or in the workbook itself.

HTH,
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.