• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Assign a macro from a text in a cell

Portucale

Member
Hi,

I have a table which the text within the cells changes according to what is chosen by the user, I need to assign a macro to the shape in each cell, the macro would be the same name as in the cell, example
A1= Today (macro would be Today)
A1= Week (macro would be Week)
Any help is very much appreciated,

Thanks in advance,
 
You have one macro like

Code:
If [a1]="Week" then
Call Week
Else
Call Today
End if
 
Thanks Hui,

but the issue is that in A1 out maybe around 25 different combinations, not sure if something like that would work;

Code:
Dim MyString As String
MyString = ("A1").value
Call MyString

Being MyString = to the macro/sub name

Thanks for the help
 
Hi ,

If you search for Application.Caller on this forum , you will find enough examples of my code , which do exactly the same thing.

If you have difficulty , please upload your sample workbook with at least a few shapes , and I'll put in the code.

Narayan
 
Back
Top