After I created a macro, how do I run this macro in code ?
After I created a macro, how do I run this macro in code ?
sub created_makro()
'bla bla
end sub
sub other_macro()
call created_makro
end sub
is that what u looking for?
> After I created a macro, how do I run this macro in code ?
>
>
Good morning Man Utd (???)
...or if you're feeling really lazy you can miss out the "Call".
Sub other_macro()
created_makro
End Sub
HTH
DominicB
exactly the OP's point
other_macro will give compile error
if created_macro does not exist.
use
application.run thisworkbook.name & "!created_macro"
make sure created_macro is not private.
--
keepITcool
| www.XLsupport.com | keepITcool chello nl | amsterdam
Snake Plissken wrote :
> sub created_makro()
>
> 'bla bla
>
> end sub
>
>
> sub other_macro()
>
> call created_makro
>
> end sub
>
>
> is that what u looking for?
>
> > After I created a macro, how do I run this macro in code ?
> >
> >
Sorry for my lack of macro knowledge, I think macro is a sort of
function/procedure.
What I need to do is:
When I fill in the cell in worksheet A, eg. B3 has value "Peter", I will
call a macro/function/procedure to search through a range of cells in
worksheet B, eg. A2:D200, if I find the matched value in column A is also
"Peter", eg A10, then I need to fetch the values of B10, C10, D10, fill in
the worksheet A cells C3, D3, E3 from the corresponding row in the worksheet
B of the matched value.
"keepITcool" <[email protected]> wrote in message
news:[email protected]...
>
> exactly the OP's point
>
> other_macro will give compile error
> if created_macro does not exist.
>
> use
> application.run thisworkbook.name & "!created_macro"
>
> make sure created_macro is not private.
>
>
> --
> keepITcool
> | www.XLsupport.com | keepITcool chello nl | amsterdam
>
>
> Snake Plissken wrote :
>
> > sub created_makro()
> >
> > 'bla bla
> >
> > end sub
> >
> >
> > sub other_macro()
> >
> > call created_makro
> >
> > end sub
> >
> >
> > is that what u looking for?
> >
> > > After I created a macro, how do I run this macro in code ?
> > >
> > >
i think you are a recent visitor to this newsgroup/forum
and I also think you are just discovering excel
IMO for the moment you should stick to formulas and functions...
this NG is concerned with VBA/programming/macros.
try a different group:
try microsoft.public.excel.worksheetfunctions
VanTheMan!!!
--
keepITcool
| www.XLsupport.com | keepITcool chello nl | amsterdam
Man Utd wrote :
> Sorry for my lack of macro knowledge, I think macro is a sort of
> function/procedure.
> What I need to do is:
> When I fill in the cell in worksheet A, eg. B3 has value "Peter", I
> will call a macro/function/procedure to search through a range of
> cells in worksheet B, eg. A2:D200, if I find the matched value in
> column A is also "Peter", eg A10, then I need to fetch the values of
> B10, C10, D10, fill in the worksheet A cells C3, D3, E3 from the
> corresponding row in the worksheet B of the matched value.
>
> "keepITcool" <[email protected]> wrote in message
> news:[email protected]...
> >
> > exactly the OP's point
> >
> > other_macro will give compile error
> > if created_macro does not exist.
> >
> > use
> > application.run thisworkbook.name & "!created_macro"
> >
> > make sure created_macro is not private.
> >
> >
> > --
> > keepITcool
> > > www.XLsupport.com | keepITcool chello nl | amsterdam
> >
> >
> > Snake Plissken wrote :
> >
> > > sub created_makro()
> > >
> > > 'bla bla
> > >
> > > end sub
> > >
> > >
> > > sub other_macro()
> > >
> > > call created_makro
> > >
> > > end sub
> > >
> > >
> > > is that what u looking for?
> > >
> > > > After I created a macro, how do I run this macro in code ?
> > > >
> > > >
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks