LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 31
Default UDF, Type it or use Insert Function

Excel 2002, Win XP
I remember being told in the past that a UDF must be entered using the
function wizard (Insert Function dialog box) and that typing the function
into a cell would not work.
I have 3 UDFs below. The 3rd one uses the first 2. During development,
I was able to utilize either of the first 2 by typing them into a cell
manually. The 3rd one, no. The 3rd one required the function wizard to
make it work.
What is the rule that allows the first 2 to work (by typing direct) and
the 3rd one to require the function wizard. Thanks for your help as always.
For your information, this has to do with the military 8 digit date
format. Otto
Function DateFrom8(j As Range) As Date
DateFrom8 = DateSerial(Left(j, 4), Mid(j, 5, 2), Right(j, 2))
End Function

Function DateTo8(i As Date) As String
DateTo8 = Year(i) & _
IIf(Len(Month(i)) 1, Month(i), "0" & Month(i)) & _
IIf(Len(Day(i)) 1, Day(i), "0" & Day(i))
End Function

Function IncDate(k As Range) As String
Dim TheDate As Date
TheDate = DateFrom8(k)
'The "5" in the following line is actually a calculated variable.
'The "5" is used here for development purposes only'
TheDate = _
DateSerial(Year(TheDate), Month(TheDate) + 5, Day(TheDate))
IncDate = DateTo8(TheDate)
End Function


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
IF TYPE FUNCTION Steve Excel Worksheet Functions 4 October 2nd 09 04:08 PM
some type of IF function WHERE IS THE ANY KEY???? Excel Worksheet Functions 2 September 15th 08 08:57 PM
how to type in 1 workbook & automatically insert in another book? IM Excel Worksheet Functions 1 August 3rd 06 03:12 PM
NVL type function Jonathan Excel Worksheet Functions 5 May 16th 06 07:58 PM
Help with TYPE function DMDave Excel Discussion (Misc queries) 5 May 7th 06 06:38 PM


All times are GMT +1. The time now is 01:26 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"