Home |
Search |
Today's Posts |
|
#1
|
|||
|
|||
how can i call a sub() automatically when someone click on sheet1
Hi
I have a function, that is to be called when someone click on the sheet1. can someone tell me how do I do this. the name of that sub is FindRelatedVal() Sub FindRelatedVal() ............................ End Sub |
#2
|
|||
|
|||
You can attach the function (macro) to the activate worksheet event for sheet
one. In the visual basic editor click sheet1 on the left explorere window, then in the code window on the right where the drop down list says declaration change that to This Workbook, then on the right dropdown lists select Activate. Add your code and it should run when you click sheet1. HTH "Saadi" wrote: Hi I have a function, that is to be called when someone click on the sheet1. can someone tell me how do I do this. the name of that sub is FindRelatedVal() Sub FindRelatedVal() ............................ End Sub |
#3
|
|||
|
|||
It Worked thanks Jimbola.
"Jimbola" wrote: You can attach the function (macro) to the activate worksheet event for sheet one. In the visual basic editor click sheet1 on the left explorere window, then in the code window on the right where the drop down list says declaration change that to This Workbook, then on the right dropdown lists select Activate. Add your code and it should run when you click sheet1. HTH "Saadi" wrote: Hi I have a function, that is to be called when someone click on the sheet1. can someone tell me how do I do this. the name of that sub is FindRelatedVal() Sub FindRelatedVal() ............................ End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Change cell back color on click | Excel Discussion (Misc queries) | |||
Automatically Populating Worksheet from Collected Input for Pricelist | Excel Worksheet Functions | |||
Automatically Populating Worksheet from Collected Input for Pricelist | Excel Worksheet Functions | |||
Copy values from Sheet1 to Sheet2 | Excel Discussion (Misc queries) | |||
Undoing LINKS in Excel 2000 | New Users to Excel |