Solved

user defined functions in Google Docs spreadsheet

Posted on 2013-12-12
3
468 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: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone 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

The choice of selecting a perfect productive suite for one’s organization is a critical decision that an IT Manager or a CIO has to make. And when it comes to choosing a cloud-based productivity suite, the choice gets all the more difficult. This is…
You can provide a virtual interface for remote stakeholders in a SWOT analysis through a Google Drawing template. By making real time viewing and collaboration possible, your team can build a stronger product.
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

808 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