Solved

user defined functions in Google Docs spreadsheet

Posted on 2013-12-12
3
459 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 80

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Whether you’re looking to gather data for research or gather feedback on an idea, being able to build and distribute your own online survey is not only cost-effective, but allows you to reach a larger audience and receive results in real-time. Googl…
Explore the encryption capabilities built into Google Apps and how these features can help you meet privacy policy and regulatory compliance, but are not a full solution. Understand and compare the most popular email encryption services for Google A…
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…

760 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now