Forum Home
Press F1
 
Thread ID: 108900 2010-04-16 03:25:00 How to install VB script in Excel 2000 GordonBennet (13808) Press F1
Post ID Timestamp Content User
877090 2010-04-16 03:25:00 Hi All

Very basic question:

I've found a VB script on the internet that does a function that I want. When it is installed one can key =ScriptName(parameter1, parameter2)

All the code is provided but I don't understand how to get it into Excel so I can use it. I tried <Tools>, <Macro>, <Visual Basic Editor> and I get a window I can paste into, but I don't understand how to name it, save it and have it available for use.

Step-by-step please - I'm a complete novice on scripts.


Thanks.
GordonBennet (13808)
877091 2010-04-16 03:48:00 You were on the right track GB - what you have is the VBA code for a UDF (User Defined Function).

From the default view when you open Excel, press Alt+F11 to open the VBA editor. Go to Insert, select Module and paste your code in there.

Close the VBA editor, and click the Insert Function (fx). Select the 'Or select from category' dropdown box, and you should see User Defined Function at the bottom. Select this, and your UDF should appear.
nofam (9009)
877092 2010-04-16 04:03:00 Can't edit the original post (and lost all my typing dammit!)

Here is the site that has the code: SplitText (www.ozgrid.com)

Just in case it helps to see what I'm trying to install.
GordonBennet (13808)
877093 2010-04-16 04:07:00 You were on the right track GB - what you have is the VBA code for a UDF (User Defined Function).

From the default view when you open Excel, press Alt+F11 to open the VBA editor. Go to Insert, select Module and paste your code in there.

Close the VBA editor, and click the Insert Function (fx). Select the 'Or select from category' dropdown box, and you should see User Defined Function at the bottom. Select this, and your UDF should appear.

Ah!

Thank you so much. I was getting so frustrated.
GordonBennet (13808)
877094 2010-04-16 04:28:00 Ah!

Thank you so much . I was getting so frustrated .

Glad to help - UDF's are incredibly useful things, as is all VBA really . :thumbs:
nofam (9009)
1