RE: Run or Call
- From: "Jim Thomlinson" <jamest@xxxxxxxxxxxxxxxxxxxx>
- Date: Fri, 26 Aug 2005 11:57:06 -0700
Sticking with the key word "Call" (I personally neve use run) the use of it
is optional. As a matter of readability I normally include it whenever I
refer to a procedure that I have coded in my project. That way I know that it
refers to a procedure that I wrote and is not a key work in VBA. I find that
it makes things a little more clear and readable. Additionally when you use
Call then the arguments of the procedure must be enclosed in brackets which I
find makes the code a little more readable. But it is entirely optional.
However you choose to do it just be consistent... IMO
--
HTH...
Jim Thomlinson
"MBlake" wrote:
> Hi,
> I'd appreciate some advice on when to use Run and when to use Call within
> vba. For example in Sheet1 the following code works fine and all the
> intended macros run when the relevant CommandButtons are pressed. However I
> need to understand when to use the Call statement and when to use Run. All
> I know at present is that use of Run requires "" and Call does not.
>
> Thanks,
> Mickey
>
> Option Explicit
>
> Private Sub cbo28Day_Click()
> Call sort28
> End Sub
>
> Private Sub cboCritical_Click()
> Call sortCritical
> End Sub
>
> Private Sub cboEnterData_Click()
> Run "formNew"
> End Sub
>
>
>
.
- Follow-Ups:
- Re: Run or Call
- From: MBlake
- Re: Run or Call
- References:
- Run or Call
- From: MBlake
- Run or Call
- Prev by Date: Re: Fast way to clear Listbox selection
- Next by Date: Re: VBA routine (101)
- Previous by thread: Re: Run or Call
- Next by thread: Re: Run or Call
- Index(es):