Solved

user defined functions in Google Docs spreadsheet

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Google Forms is a great platform to easily create polls, questionnaires and surveys. The service allows you to receive data in real-time and is a simple way to conduct large-scale surveys that can be distributed to multiple people.   The platform …
Freeze panes is an option within all variants of Excel to enable parts of a sheet to remain stationary when the cursor is in another part of the sheet. This is a very useful feature which is overlooked or under used.
This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.
This Micro Tutorial will demonstrate how to create pivot charts out of a data set. I also added a drop-down menu which allows to choose from different categories in the data set and the chart will automatically update.

911 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

24 Experts available now in Live!

Get 1:1 Help Now