Creating a action for a defined object

  • Thread starter Thread starter Adrix
  • Start date Start date
A

Adrix

hello
first of all my apologizes for allways posting questions instead o
solutions, but I m still too beginner in programming.

I create a macro that format a range . Is it possible to "give" th
range the power to call it. Let´s say it is possible what i want to d
is have the abillity to call it just like:

range("myrange").mymacro

I know it sounds silly but..

thank you in advance

Adri
 
No you can't do that, but you can pass the range to the macro, like

Call myMacro(Range("A1:A10")

....

Sub myMacro(Rng As Range)

Msgbox rng.Address

End Sub

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
thank you any way.

ps- And it is possible to define a new obejct capable to do a ne
action?

thank
 
Do you mean such as adding a button to a sheet?

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top