Solved

user defined functions in Google Docs spreadsheet

Posted on 2013-12-12
3
473 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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.
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
In this Experts Exchange video Micro Tutorial, I'm going to show how small business owners who use Google Apps can save money by setting up what is called a catch-all email address in their Gmail accounts. By using the catch-all feature, small busin…
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

707 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