ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Creating a action for a defined object (https://www.excelbanter.com/excel-programming/295954-creating-action-defined-object.html)

Adrix[_4_]

Creating a action for a defined object
 
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

--
Message posted from http://www.ExcelForum.com


Bob Phillips[_6_]

Creating a action for a defined object
 
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)

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

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

range("myrange").mymacro

I know it sounds silly but..

thank you in advance

Adrix


---
Message posted from http://www.ExcelForum.com/




Adrix[_5_]

Creating a action for a defined object
 
thank you any way.

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

thank

--
Message posted from http://www.ExcelForum.com


Bob Phillips[_6_]

Creating a action for a defined object
 
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)

"Adrix " wrote in message
...
thank you any way.

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

thanks


---
Message posted from http://www.ExcelForum.com/





All times are GMT +1. The time now is 06:40 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com