VBA function naming

fishyy33

New Member
Joined
Aug 2, 2016
Messages
1
I defined two functions and they are identical except the naming.
The "test1" function works but the other one does not. It returns "#REF!" error about this function.
Could you please explain to me why it is so?

The definitions of the functions are below:


=============================


[FONT=arial, helvetica, sans-serif]Function TT22221(a As Double) As Double[/FONT]
[FONT=arial, helvetica, sans-serif]TT22221 = WorksheetFunction.Log10(a)[/FONT]
[FONT=arial, helvetica, sans-serif]End Function[/FONT]
[FONT=arial, helvetica, sans-serif]
[/FONT]
[FONT=arial, helvetica, sans-serif]=============================[/FONT]
[FONT=arial, helvetica, sans-serif]
[/FONT]
[FONT=arial, helvetica, sans-serif]Function test1(a As Double) As Double[/FONT]
[FONT=arial, helvetica, sans-serif]test1 = WorksheetFunction.Log10(a)[/FONT]
[FONT=arial, helvetica, sans-serif]End Function[/FONT]


​=============================<wbr>=====​
 

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
Try putting an underscore in it

Function TT_22221(a As Double) As Double
TT_22221 = WorksheetFunction.Log10(a)
End Function
 
Upvote 0
A function name can't look like a cell reference.
 
Upvote 0

Forum statistics

Threads
1,215,517
Messages
6,125,290
Members
449,218
Latest member
Excel Master

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