Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Saadi
 
Posts: n/a
Default 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   Report Post  
Jimbola
 
Posts: n/a
Default

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   Report Post  
Saadi
 
Posts: n/a
Default

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Change cell back color on click Dave Peterson Excel Discussion (Misc queries) 0 January 24th 05 10:50 PM
Automatically Populating Worksheet from Collected Input for Pricelist David Littrell via OfficeKB.com Excel Worksheet Functions 1 January 6th 05 05:04 PM
Automatically Populating Worksheet from Collected Input for Pricelist David Littrell via OfficeKB.com Excel Worksheet Functions 0 January 6th 05 04:29 PM
Copy values from Sheet1 to Sheet2 Eintsein_mc2 Excel Discussion (Misc queries) 1 January 6th 05 05:02 AM
Undoing LINKS in Excel 2000 jayceejay New Users to Excel 3 January 4th 05 05:58 PM


All times are GMT +1. The time now is 08:42 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"