-
Solved: Runing a macro by clicking on a sheet
Hi,
so far you have been very helpfull, so I hope you will help me with this problem also
I need to run macros by clicking on a certain worksheet.
So far I have got this:
[VBA]Sub Worksheet_Activate()
Call ColorBackgorund
Call SetColour
Call RecalculateColor
End Sub[/VBA]
Can it be done, to call the whole Module2, where all the subs are.
And i need it to activate on clicking on worksheet "Performance Report"
thanks in advance!
-
Fixed it myself!
[VBA]Sub Worksheet_Activate()
Call Module2.ColorBackground
Call Module2.RecalculateColor
End Sub
[/VBA]
if anyone will need this in the future, here it is!
thanks again!
-
You don't need to prefix with a Module name unless you use the same Sub name in other Modules. That is not something that I would recommend but if you do, prefixing is required.
[vba]Sub Worksheet_Activate()
ColorBackgorund
SetColour
RecalculateColor
End Sub [/vba]
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules