Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Richard Latter
 
Posts: n/a
Default Problem using VBA functions....

Hello All,

Function Celsius(dFahrenheit As Double) As Double
Celsius = (dFahrenheit - 32) * (5 / 9)
End Function

As a demo, I have been trying to get a simple VBA function to work
using Excel without success. I believe I've created it successfully
using the Visual Basic Script Editor. I have tried using it in a
worksheet, but whenever I try the formula in a cell, I keep getting
#NAME?.

EG. Cell A2 "=Celsius(3)"

No matter what I try to do, it will not accept this formula even
though I believe it's correct. From my investigation, it appears that
the worksheet for whatever reason cannot see this function I have
created, but I do no understand why.

Can anyone help?

In addition, I have installed the atpvbaen.xls and funcres.xla
add-ins. However, if I try to access these in the project manager, it
prompts me for a password (which I do not know). Is this normal?

Many thanks in advance,

Richard

BTW Subroutines do work under VBA.
  #3   Report Post  
JulieD
 
Posts: n/a
Default

Hi Richard

where did you put the function code .. if you put it in personal.xls you
need to prefix the function name with personal e.g.
=PERSONAL.XLS!Celsius(3)

to check if this is the case, use the fx (paste function) icon and the
user-defined category ... you should be able to see your function there.

Cheers
JulieD


"Richard Latter" wrote in message
om...
Hello All,

Function Celsius(dFahrenheit As Double) As Double
Celsius = (dFahrenheit - 32) * (5 / 9)
End Function

As a demo, I have been trying to get a simple VBA function to work
using Excel without success. I believe I've created it successfully
using the Visual Basic Script Editor. I have tried using it in a
worksheet, but whenever I try the formula in a cell, I keep getting
#NAME?.

EG. Cell A2 "=Celsius(3)"

No matter what I try to do, it will not accept this formula even
though I believe it's correct. From my investigation, it appears that
the worksheet for whatever reason cannot see this function I have
created, but I do no understand why.

Can anyone help?

In addition, I have installed the atpvbaen.xls and funcres.xla
add-ins. However, if I try to access these in the project manager, it
prompts me for a password (which I do not know). Is this normal?

Many thanks in advance,

Richard

BTW Subroutines do work under VBA.



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
array functions and ISNUMBER() Henrik Excel Worksheet Functions 1 February 10th 05 12:12 AM
Freeze Pane problem in shared workbooks JM Excel Discussion (Misc queries) 1 February 1st 05 12:04 AM
# of Functions per cell SUB-ZERO Excel Worksheet Functions 3 January 23rd 05 10:35 PM
Row Autofit problem Excel 2003 Matthias Klaey Excel Discussion (Misc queries) 0 January 19th 05 05:33 PM
Paper Tray selection Problem, Michael Hoffmann Excel Discussion (Misc queries) 4 December 3rd 04 09:08 PM


All times are GMT +1. The time now is 09:50 PM.

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"