LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 61
Default Function/Sub

OK; I was beginning to realize that: I had some cockpit error when I
reported a #NAME? error. What I really got was a circular reference error
which I guess makes sense. Subs can change stuff on the worksheet sao I
thought maybe I could do multiple stuff with a function by calling a Sub from
the function. Thanks.
--
Les

"Chip Pearson" wrote:

A Function or Sub called from a worksheet cell, directly or indirectly,
cannot modify any part of the Excel environment, including changing the
contents of any cell, including the cell from which it was called. I'm
surprised that you get a #NAME error. I would have expected that you would
get a #VALUE error.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel, 10 Years
Pearson Software Consulting
www.cpearson.com
(email on the web site)


"LesHurley" wrote in message
...
well maybe Sean answered it. Suppose I have:

Sub Good()
Selection.Value="Good"
End Sub

Function OK()
Good
End Function

The Sub procedure works OK, it returns "Good" to the selected cell in the
worksheet by clicking tools/macros/good, but typing =OK() gives a #NAME
error.--


"Bob Phillips" wrote:

In VBA yes. A function can call a sub and vice versa.

What makes you think that it might not?

--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my
addy)



"LesHurley" wrote in message
...
Is it possible to make a VBA Function call a Sub ? I don't have any
problem
calling either from one of the same kind.--
Thanks for your help




 
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
Excel - User Defined Function Error: This function takes no argume BruceInCalgary Excel Programming 3 August 23rd 06 08:53 PM
Need to open the Function Arguments window from VBA for a user defined function. [email protected] Excel Programming 0 June 20th 06 03:53 PM


All times are GMT +1. The time now is 06:30 AM.

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

About Us

"It's about Microsoft Excel"