#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 52
Default about udf..



function fnv()
etc.....
fnv="xxxx"
end function

i want to replace fnv to sharing letter in syntex.
namely, if I change function header name only, syntex need not changed.

for example,,,
function fnv(k)

if k=1 then
thisFunction="xxxx"
else
thisFunction="yyy"
endif
end function

i change "fnv" name only. and then execute normally.
for example,replace name fnv to fnv2....

function fnv2(k)

if k=1 then
thisFunction="xxxx"
else
thisFunction="yyy"
endif
end function



*** Sent via Developersdex http://www.developersdex.com ***
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,588
Default about udf..

VBA doesn't support a

Return "xxxxx"

syntax. Why do you need this: is it just for the minor convenience of only changing the one line and not 2 or more?

If the return value is set in multiple places in a function I always use something like:

'*************
Function blah(v) as integer
Dim retVal as integer

if v=1 then
retVal=2
else
retVal=3
end if

blah = retVal
end function
'**************

Tim



"tom taol" wrote in message ...


function fnv()
etc.....
fnv="xxxx"
end function

i want to replace fnv to sharing letter in syntex.
namely, if I change function header name only, syntex need not changed.

for example,,,
function fnv(k)

if k=1 then
thisFunction="xxxx"
else
thisFunction="yyy"
endif
end function

i change "fnv" name only. and then execute normally.
for example,replace name fnv to fnv2....

function fnv2(k)

if k=1 then
thisFunction="xxxx"
else
thisFunction="yyy"
endif
end function



*** Sent via Developersdex http://www.developersdex.com ***



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



All times are GMT +1. The time now is 01:56 AM.

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"