Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #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


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default UDF, Type it or use Insert Function

who ever told you that was obviously wrong.

I entered all three by typing them in and had no problem.

I rarely use the function wizard to enter anything. I have never found it
was necessary.

Regards,
Tom Ogilvy



"Otto Moehrbach" wrote in message
...
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




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 968
Default UDF, Type it or use Insert Function

Mostly the difference is that the function wizard uses EVALUATE (I think) ro
evaluate each keystroke as it goes along.

hth
Charles
______________________
Decision Models
The Excel Calculation Site

www.DecisionModels.com
"Tom Ogilvy" wrote in message
...
who ever told you that was obviously wrong.

I entered all three by typing them in and had no problem.

I rarely use the function wizard to enter anything. I have never found it
was necessary.

Regards,
Tom Ogilvy



"Otto Moehrbach" wrote in message
...
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






  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 77
Default UDF, Type it or use Insert Function

I believe one of the advantages of using the function wizard is that it will
put the name of the Workbook in front of the Function. This helps when
calling a function in another workbook, or perhaps when the same function
name exists in two different workbooks. For example, it saves typing when
calling a function located in Personal.xls.

=Personal.xls!YourFunction( )

--
Dana DeLouis
Windows XP & Office XP
= = = = = = = = = = = = = = = = =


"Charles Williams" wrote in message
...
Mostly the difference is that the function wizard uses EVALUATE (I think)

ro
evaluate each keystroke as it goes along.

hth
Charles
______________________
Decision Models
The Excel Calculation Site

www.DecisionModels.com
"Tom Ogilvy" wrote in message
...
who ever told you that was obviously wrong.

I entered all three by typing them in and had no problem.

I rarely use the function wizard to enter anything. I have never found

it
was necessary.

Regards,
Tom Ogilvy



"Otto Moehrbach" wrote in message
...
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








Reply
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 09:07 AM.

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

About Us

"It's about Microsoft Excel"