UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> User Defined Function    
 
   
engelwood
post Jul 7 2005, 09:19 AM
Post #1

UtterAccess Member
Posts: 40
From: Missouri, United States



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
Go to the top of the page
 
+
Luceze
post Jul 7 2005, 10:13 AM
Post #2

UtterAccess VIP
Posts: 2,601
From: Dallas, Texas USA



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,
Go to the top of the page
 
+

Thank you for your support! Reply to this topicStart new topic

Jump To Forum:
 



RSS Go to Top  ·  Lo-Fi Version Time is now: 18th June 2013 - 08:34 PM