View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Hari[_3_] Hari[_3_] is offline
external usenet poster
 
Posts: 157
Default Macro, Module, function, sub and This workbook and sheets ?

Hi,

For the last couple of days I have been indiscriminately pinching codes from
NG and pasting it in to This workbook or by inserting new modules without
understanding which should be used for what.

I am a newbie and want to learn VBA with excel.

Couple of questions based on this:-

1. What is the difference between Sub, Function, Module and code.

2. If I get a code ( from NG) where should I add it . Should I add it "This
workbook" or a new module. If possible please tell me in what circumstances
one should be adding the code in which of the above 2

3. What is the difference between Public, private with reference to both sub
and function.

4. When do we add codes to "Sheet1" rather than workbook.

5. Based on info from newsgroups I learned that a Macro/Module ( I believe
macro is recorded and module is anything which is written, please correct me
if am wrong) could be called. Can we call both a macro and function from
another function/macro

6. Can a module in sheet call a module in another shet/workbook or from
module 1.

Please guide me to the right source for learing these bsic concepts if
possible.

Regards,
Hari
India