Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a macro (made for Excel - Windows), which url encode strings - i.e. space becomes %20. When I open the *.xlsm on a Mac with Excel installed(Office for Mac 2011), it does not work. No errors - nothing!! I found this from googling - http://blog.mclaughlinsoftware.com/2010/11/04/excel-2011-without-udfs/ I have tried re-installing as described in the link above with no success. I can not even get the small "tests" to work as described.

Function hello()
  hello = "Hello World!"
End Function

Function hellowhom(nameIn As Variant)
  hellowhom = "Hello " + CStr(nameIn) + "!"
End Function 

And doing =hello() or =hellowhom(A1) in the formula builder.

Any hints or tips??

share|improve this question
    
What is the value in the cell after you enter =hello()? Did you make sure to put the functions in a Module (not the Worksheet/Workbook)? – Zairja Aug 8 '12 at 13:29
    
The value is #NAME? after entering =hello(). And I have tried to move the functions into a Class module - it does not change anything... – jens Aug 14 '12 at 8:09
    
ohh - just moved it into a MODULE ;o) and now it works!! Thx!!! @Zairja – jens Aug 14 '12 at 8:58
    
I've added my comment as an answer which you may accept to "close" the question. :) – Zairja Aug 14 '12 at 12:39
    
@ZygD: On these tag edits, generally use a version-agnostic tag ([microsoft-excel] if the issue and solution apply to all versions. Use a version-specific tag when it is unique to a specific version, or include it if you aren't sure. You usually don't need both, or redundant tags like [microsoft-office] when the question is about a specific application like Excel. The [mac] tag is for Mac hardware questions. Use the appropriate OSX tag if it relates to the operating system. Try to include a tag specific to the problem, like [macros] or [vba], in this case. – fixer1234 Mar 22 '15 at 0:35

"The code for a UDF should be placed in a standard code module, not one of the Sheet modules and not in the ThisWorkbook module. In the VBA editor, go to the Insert menu and choose Module. This will insert a new code module into the project. A module can contain any number functions, so you can put many functions into a single code module. You can change the name of a module from Module1 to something more meaningful by pressing the F4 key to display the Properties window and changing the Name property to whatever you want."

-from Chip Pearson's great site

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .