Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default using a VB function in a spreeadsheet

I opened the VB editor and added a simple function to the General sheet. I
tried both ThisWorkbook and the specific sheet.

Public Function Ripple(x As Double) As Double

Ripple = x

End Function

In the spreadsheet I try to put =Ripple(A1), etc, into cells, but I get a
#Name? error. How do I get the spreadsheet to recognize the VB function?


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 718
Default using a VB function in a spreeadsheet

You have to plce your code in a Module.

--
AP

"Bill Brehm " <<don't want any spam a écrit dans le message de
...
I opened the VB editor and added a simple function to the General sheet. I
tried both ThisWorkbook and the specific sheet.

Public Function Ripple(x As Double) As Double

Ripple = x

End Function

In the spreadsheet I try to put =Ripple(A1), etc, into cells, but I get a
#Name? error. How do I get the spreadsheet to recognize the VB function?




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default using a VB function in a spreeadsheet

I tried that and I still get the #Name? error. I have hit F9 to recalculate.
As a test I added two Ripple functions and when I added a new cell with that
name it popped up an error the notice the name conflict. So it seems to be
trying.

Any other suggestion?


"Ardus Petus" wrote in message
...
You have to plce your code in a Module.

--
AP

"Bill Brehm " <<don't want any spam a écrit dans le message de
...
I opened the VB editor and added a simple function to the General sheet.
I
tried both ThisWorkbook and the specific sheet.

Public Function Ripple(x As Double) As Double

Ripple = x

End Function

In the spreadsheet I try to put =Ripple(A1), etc, into cells, but I get a
#Name? error. How do I get the spreadsheet to recognize the VB function?






  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 718
Default using a VB function in a spreeadsheet

Works by me.
see example: http://cjoint.com/?dqjN3isIYk

HTH
--
AP

"Bill Brehm " <<don't want any spam a écrit dans le message de
...
I tried that and I still get the #Name? error. I have hit F9 to

recalculate.
As a test I added two Ripple functions and when I added a new cell with

that
name it popped up an error the notice the name conflict. So it seems to be
trying.

Any other suggestion?


"Ardus Petus" wrote in message
...
You have to plce your code in a Module.

--
AP

"Bill Brehm " <<don't want any spam a écrit dans le message de
...
I opened the VB editor and added a simple function to the General

sheet.
I
tried both ThisWorkbook and the specific sheet.

Public Function Ripple(x As Double) As Double

Ripple = x

End Function

In the spreadsheet I try to put =Ripple(A1), etc, into cells, but I get

a
#Name? error. How do I get the spreadsheet to recognize the VB

function?








  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default using a VB function in a spreeadsheet

Strange. You are right. Mine doesn't work but yours does. I just deleted
mine and renamed yours and I am happy. Thanks.

"Ardus Petus" wrote in message
...
Works by me.
see example: http://cjoint.com/?dqjN3isIYk

HTH
--
AP

"Bill Brehm " <<don't want any spam a écrit dans le message de
...
I tried that and I still get the #Name? error. I have hit F9 to

recalculate.
As a test I added two Ripple functions and when I added a new cell with

that
name it popped up an error the notice the name conflict. So it seems to
be
trying.

Any other suggestion?


"Ardus Petus" wrote in message
...
You have to plce your code in a Module.

--
AP

"Bill Brehm " <<don't want any spam a écrit dans le message de
...
I opened the VB editor and added a simple function to the General

sheet.
I
tried both ThisWorkbook and the specific sheet.

Public Function Ripple(x As Double) As Double

Ripple = x

End Function

In the spreadsheet I try to put =Ripple(A1), etc, into cells, but I
get

a
#Name? error. How do I get the spreadsheet to recognize the VB

function?












  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default using a VB function in a spreeadsheet

I was having the same problem but only when I placed the function in
Personal.xls.
When I placed the same function in a module in the workbook that I wanted to
use it in, it worked fine.

Dunno if you've already tried this?!


"Ardus Petus" wrote:

Works by me.
see example: http://cjoint.com/?dqjN3isIYk

HTH
--
AP

"Bill Brehm " <<don't want any spam a écrit dans le message de
...
I tried that and I still get the #Name? error. I have hit F9 to

recalculate.
As a test I added two Ripple functions and when I added a new cell with

that
name it popped up an error the notice the name conflict. So it seems to be
trying.

Any other suggestion?


"Ardus Petus" wrote in message
...
You have to plce your code in a Module.

--
AP

"Bill Brehm " <<don't want any spam a écrit dans le message de
...
I opened the VB editor and added a simple function to the General

sheet.
I
tried both ThisWorkbook and the specific sheet.

Public Function Ripple(x As Double) As Double

Ripple = x

End Function

In the spreadsheet I try to put =Ripple(A1), etc, into cells, but I get

a
#Name? error. How do I get the spreadsheet to recognize the VB

function?









  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default using a VB function in a spreeadsheet

No I hadn't put it in personal.xls. I first started out putting it in
Microsoft Excel Objects, Sheet1 and ThisWorkbook. Then at Ardus Petus
suggestion I put it in Modules, Module1 but it still didn't work. Just now I
started over from scratch and it works fine. So I guess putting it in the
wrong place caused me some trouble.


"piyush1982" wrote in message
...
I was having the same problem but only when I placed the function in
Personal.xls.
When I placed the same function in a module in the workbook that I wanted
to
use it in, it worked fine.

Dunno if you've already tried this?!


"Ardus Petus" wrote:

Works by me.
see example: http://cjoint.com/?dqjN3isIYk

HTH
--
AP

"Bill Brehm " <<don't want any spam a écrit dans le message de
...
I tried that and I still get the #Name? error. I have hit F9 to

recalculate.
As a test I added two Ripple functions and when I added a new cell with

that
name it popped up an error the notice the name conflict. So it seems to
be
trying.

Any other suggestion?


"Ardus Petus" wrote in message
...
You have to plce your code in a Module.

--
AP

"Bill Brehm " <<don't want any spam a écrit dans le message de
...
I opened the VB editor and added a simple function to the General

sheet.
I
tried both ThisWorkbook and the specific sheet.

Public Function Ripple(x As Double) As Double

Ripple = x

End Function

In the spreadsheet I try to put =Ripple(A1), etc, into cells, but I
get

a
#Name? error. How do I get the spreadsheet to recognize the VB

function?











Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel Data Validation/Lookup function does function correcty Kirkey Excel Worksheet Functions 2 May 25th 09 09:22 PM
copy of excel file not showing formulal/function in the function b oaallam Excel Discussion (Misc queries) 4 September 6th 07 01:20 PM
LINKEDRANGE function - a complement to the PULL function (for getting values from a closed workbook) [email protected] Excel Worksheet Functions 0 September 5th 06 03:44 PM
Emulate Index/Match combo function w/ VBA custom function Spencer Hutton Excel Worksheet Functions 2 May 2nd 05 05:26 PM
User-Defined Function pre-empting Built-in Function? How to undo???? MarWun Excel Programming 1 August 6th 03 09:31 PM


All times are GMT +1. The time now is 07:20 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"