If it ain't broke don't fix it?

medeardorff

New Member
Joined
Mar 5, 2013
Messages
12
I had created a couple of hundred XLM functions in the OLD days when that was the paradigm prior to VBA. I am a structural engineer and I automated my office with spreadsheets that optimized designs, did nice formatting using the arcana of XLM. It was quite a skill; but no more.

Now I am converting them to VBA, A language I programmed in as VB6 and earlier.

The first issue I am having is getting around the #NAME error I am receiving. The UDF is in a standard module. The code is shown below.

Option Explicit
Option Base 1

Function DecFtToIntFt(Ft As Long) As Integer
DecFtToIntFt = Int(Ft)
End Function

Here I am just returning the integer portion of a decimal representation of a foot measurement to be rendered as part of a dimension string. Unfortunately, I get a #NAME error.
 

Attachments

  • 2021-09-26_13-59-02.png
    2021-09-26_13-59-02.png
    14.2 KB · Views: 6

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
Is the UDF in the workbook you are trying to use it in?
 
Upvote 0
In that case don't use the workbook or module name, it should just be
Excel Formula:
=DecFtToIntFt(N53)
 
Upvote 0
In that case check that macros are enabled.
 
Upvote 0
Solution
Is that in the Trust Center? I enabled VBA macros. Still no change. It must be simple.
 
Last edited:
Upvote 0
Is that in the Trust Center? I enabled VBA macros. Still no change. It must be simple.
I reopened the workbook; the macro ran properly after that. Now I must properly sign these so that I can send these out to others when I sell them.

Thank you for your help. Saved me a bunch and taught me information I will not forget.
 
Upvote 0
Glad you sorted it & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,215,011
Messages
6,122,677
Members
449,092
Latest member
tayo4dgacorbanget

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