VBA Functions

JamesPW

Board Regular
Joined
Nov 4, 2005
Messages
51
Office Version
  1. 2019
Platform
  1. MacOS
I have a simple Function in a VBA module. This is for example, the code is not the problem.
Option Explicit
Function SumColor()

SumColor = 88

End Function
As far as I can tell I've put it in "Personal.xlsb"

The function does not appear in the "fx (functions)" list. Plus it gives me "#Name?" if I type in the function name.
I have several subs that run fine but this is my first function. What am i doing wrong?
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
I think you have to set Personal.xlsb as a reference in your vba project, or preface the call with the name of the workbook containing the function, such as
Personal.xlsb!SumColor
 
Upvote 0
Solution

Forum statistics

Threads
1,215,069
Messages
6,122,953
Members
449,095
Latest member
nmaske

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