Function problems

young engineer

Board Regular
Joined
Mar 3, 2009
Messages
100
Hi All
WhenI am using a function it only runs when I name the cells but not when I am using a cell reference like:
=Frucpurity(E2,F2,G2) . . . . . does not work

=Frucpurity(E2,dil,angle1) . . . . .works

The problem when using the function with cells named, only the first cells in the column are named and only the first calculation is accurate. the following functions still use the fist cells that are named to calculate.

Why is my function not working when usig cell reefences.
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
What do you mean by "does not work"? Does it produce an error, or wrong results or what? there should not be any need to name cells rather than using a range reference as it makes no difference to the function.
 
Upvote 0
When i use =Frucpurity(N4,O4,P4) the error is <TABLE style="WIDTH: 48pt; BORDER-COLLAPSE: collapse" cellSpacing=0 cellPadding=0 width=64 border=0><COLGROUP><COL style="WIDTH: 48pt; mso-width-source: userset; mso-width-alt: 2340" width=64><TBODY><TR style="HEIGHT: 15pt" height=20><TD class=xl67 style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; WIDTH: 48pt; BORDER-BOTTOM: #f0f0f0; HEIGHT: 15pt; BACKGROUND-COLOR: transparent" align=middle width=64 height=20>#VALUE!</TD></TR></TBODY></TABLE>
 
Upvote 0
That means that there is an error occurring in your code presumably due to the value in one of those cells. It has nothing specifically to do with whether the cells are named or not.
 
Upvote 0
I had something similar last week and I cracked it by putting statements such as :-

Frucpurity = 100

Frucpurity = 200

throughout the code (and commenting out all the code after this point). I just went through from the top of the function to the bottom until I found the error (when the function return value changed from a number to a "VALUE error").

Kaps
 
Upvote 0
It's easier to put breakpoints in and step through the code using the Watch, Local and Immediate windows to see what is going on! :)
Additionally, all UDFs should really have error handling in so that you can provide a more meaningful error message if required.
 
Upvote 0
Alternatively you could set a breakpoint and single step thru the code & open the Locals window.

Just click in the margin of the first statement, a brown Dot will ppear. Then just [F8] to single step or [F5] to run thru to the next breakpoint.

Check the values using the Locals window
 
Upvote 0

Forum statistics

Threads
1,214,614
Messages
6,120,533
Members
448,969
Latest member
mirek8991

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top