[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

user defined functions in Google Docs spreadsheet

Posted on 2013-12-12
3
Medium Priority
?
487 Views
Last Modified: 2015-03-02
I have a user defined function, that is saved in my Excel. It's called "NumberToLetters". It converts any number into text. For example you enter "1220.10" and it outputs "one thousand two hundred and twenty dollars and 10/100"

I just have to input the formula =NumberToLetters(A1) (where A1 is the cell with the number to convert)

So anyway, all is well in Excel. Works perfectly.

But I'm starting to use Google Docs instead.

And when I imported the whole spreadsheet to Google Docs, it just gives me a #NAME? error.

So I see the function macro didn't get imported.

So I went to "tools"... "script editor" and pasted in the entire script as copied from Excel.

However, this is the error I'm getting when I save it:

1
Also, FYI, the numbers actually come out in Spanish, which is what I need, so it's not exactly like the example above.

I don't know if maybe I'm in over my head, but maybe somebody could help.

Thanks
0
Comment
Question by:gregholl
  • 2
3 Comments
 
LVL 81

Expert Comment

by:byundt
ID: 39715638
You'll need to convert your user-defined function from VBA into JavaScript to use it with Google Docs. If you haven't already found it, Google publishes documentation on how to create functions for use in spreadsheets at https://developers.google.com/apps-script/execution_custom_functions

I should also mention that in VBA, if you don't declare a variable as something, it will be a Variant. Good practice is to avoid declaring a variable as Variant when possible--so most of your variables should have been declared as String.
0
 
LVL 1

Accepted Solution

by:
gregholl earned 0 total points
ID: 39717438
0
 
LVL 1

Author Closing Comment

by:gregholl
ID: 39726201
Found an excellent solution to work around the issue
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
Many of you may be aware of the recent Google Docs scam emails that have been floating around coming from various people that you know. Here's a guide on identifying How To Identify the Scam Email You will see an email from someone you’ve had co…
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.

873 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question