Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / New Users / January 2008

Tip: Looking for answers? Try searching our database.

Running macros or functions?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
newbie - 04 Jan 2008 06:41 GMT
First of all i want to thank people who come here and help others.
I have posted a few questions and have many nice people help me.

Now for my question: I am confused. I just started a few days ago
learning to do some VBA. I noticed that when i create a macro in VBA i
see VBA makes the following code entries in the code window:

sub name1()
end sub

The name1 is the macro name that i assign when invoking the create
macro button in the macro dialog box. But when i change the code to,
Function name() the macro name that i created disappears? Now i want a
return value to go into a cell for use later on so i feel i need a
function and not a subroutine. The only other way might be to use a
subroutine but write a value back to a cell of my choosing, any
thoughts on this as far as best practice for my situation?  You can
tell i am really new at this, sorry for any dumb questions.

Andrew
Bob Phillips - 04 Jan 2008 09:03 GMT
Functions are the way to go for returning a value to a cell, they just don't
show in the macros list.

They do show in the Excel functions list, under the category User Defined.

Signature

HTH

Bob

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

> First of all i want to thank people who come here and help others.
> I have posted a few questions and have many nice people help me.
[quoted text clipped - 16 lines]
>
> Andrew
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.