View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Chip Pearson Chip Pearson is offline
external usenet poster
 
Posts: 7,247
Default a few simple newbies questions

Marco,

1) By default, everything is passed by reference. With objects,
if you specify ByVal, the address of the object is passed by
value. If you specify ByRef, the address of the object is passed
by reference. In both cases, you change the properties of the
object. The difference is that with ByVal, you can't assign the
parameter to a difference object and have that change take effect
in the calling procedure.

2) The VBA help files are fairly good.

3) Use the Formula or FormulaLocal property of the Range to place
a formula in a cell. E.g.,

Range("A1").Formula = "=SUM(B1:B10)"


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



"Marco Braun" wrote in message
...
Hello out there,

I am just getting into seriously editing my makros in VBA and I
encounter a few things I'd like to know and which must be easy

answers
for those who know.

1. if I pass an object, say a worksheet to a sub-routine will

it be
passed by value or will it be passed by reference. What I want

to know:
If I make changes on that passed worksheet will they be there

in the
routine that called and passed the sub-routine? My guess: pass

by reference.

2. Where is a good place to look up all I need to know about

functions
and subs, about objects, their methods and attribs in VBA?

Where can I
read about returned values and arguments? I can't believe the

object
catalog is the best I can get....

3. How do I place a formula in a cell?


Thanks so far
Marco