If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > PC based Database Applications > Microsoft Excel > using vba for a formula in xl

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 06-13-06, 14:04
MikeroSoft MikeroSoft is offline
Registered User
 
Join Date: Apr 2006
Posts: 47
using vba for a formula in xl

i would like to have a formula that reads a vba function
some thing like

=varAnaly(rng1 as range,rng2 as range,proof as range)


function varAnaly
if range(rng1) is a number ' is there a NAN in VBA?
and if range(rng2) is a number then

test1 = (range(rng1).value + range(rng2).value ) /2


varAnaly = (test1- proof)/proof

end func

i am having trouble with if its a # and how to write a vba function and use it as an excel formula
Reply With Quote
  #2 (permalink)  
Old 06-13-06, 14:18
norie norie is offline
Registered User
 
Join Date: Mar 2006
Posts: 163
Take a look at the IsNumeric VBA function, it'll return true for numbers.

What other difficulties are you having?
Reply With Quote
  #3 (permalink)  
Old 06-13-06, 15:33
MikeroSoft MikeroSoft is offline
Registered User
 
Join Date: Apr 2006
Posts: 47
Got it all, thanks !~
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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