Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 86
Default Run a macro after clicking into cell

I wish to run a macro after clicking into various cells.

I have 10 different macros and 10 cells with names of these macors and
I wish to run the relevant macro when I click into the cell.

ie. A1 content = "Scores" and when I click into that cell, I wish the
"Scores" macro to run.

Can this be done?
If so, how?

TIA
Esra
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 10,124
Default Run a macro after clicking into cell

Easily done but give us all the detail and the code. There is probably an
easier way.

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Esradekan" wrote in message
...
I wish to run a macro after clicking into various cells.

I have 10 different macros and 10 cells with names of these macors and
I wish to run the relevant macro when I click into the cell.

ie. A1 content = "Scores" and when I click into that cell, I wish the
"Scores" macro to run.

Can this be done?
If so, how?

TIA
Esra


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 86
Default Run a macro after clicking into cell

I have a master grid of Sports Teams (Aussie Rules), that the macros
copy and paste from the team sheets so I can see at a glance the team
home and away status, game results etc.

ie. If i want to view the Adelaide team stats, and game results etc,
i wish to copy from the team page those stats, simple copy/paste macro
(AdelaideScores). If I want Brisbane stats, I click into the Cell
with Brisbane in it, and run the macro BrisbaneScores.

Makes it easier for team comparisons.

I already have the copy/paste macros done, (ie AdelaideScores,
BrisbaneScores etc) and the grid where the macros paste, just would
rather do it by clicking in the team cell, than assigning the macro to
an object. Its tidier.

Does that make sense? Hope so


TIA for help

Esra


On Wed, 26 Mar 2008 17:39:53 -0500, "Don Guillett"
wrote:

Easily done but give us all the detail and the code. There is probably an
easier way.

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 10,124
Default Run a macro after clicking into cell

Sent him this to replace a bunch of very long macros.

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As
Boolean)
If Not Intersect(Target, Range("L6:L21")) Is Nothing Then
mysht = Application.Substitute(target, " ", "")
Range("m2") = Target
Range("m6:x21").Value = _
Sheets(mysht).Range("c6:n21").Value
End If
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Don Guillett" wrote in message
...
You really didn't give enough info but you could probably use a
double_click event from the sheet module or even a drop down list. Send
the workbook to my address below if you would like me to take a look at
making this better.

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Esradekan" wrote in message
...
I have a master grid of Sports Teams (Aussie Rules), that the macros
copy and paste from the team sheets so I can see at a glance the team
home and away status, game results etc.

ie. If i want to view the Adelaide team stats, and game results etc,
i wish to copy from the team page those stats, simple copy/paste macro
(AdelaideScores). If I want Brisbane stats, I click into the Cell
with Brisbane in it, and run the macro BrisbaneScores.

Makes it easier for team comparisons.

I already have the copy/paste macros done, (ie AdelaideScores,
BrisbaneScores etc) and the grid where the macros paste, just would
rather do it by clicking in the team cell, than assigning the macro to
an object. Its tidier.

Does that make sense? Hope so


TIA for help

Esra


On Wed, 26 Mar 2008 17:39:53 -0500, "Don Guillett"
wrote:

Easily done but give us all the detail and the code. There is probably an
easier way.





  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default Run a macro after clicking into cell

Thanks Don, your a legend, over and above what I asked, problem
sorted. I bow to your wisdom.

Esra



On Wed, 26 Mar 2008 18:13:53 -0500, "Don Guillett"
wrote:

You really didn't give enough info but you could probably use a double_click
event from the sheet module or even a drop down list. Send the workbook to
my address below if you would like me to take a look at making this better.

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
Problems Clicking on a Cell Swaskin Excel Discussion (Misc queries) 5 November 6th 07 02:48 PM
after clicking on a cell cannot get out of worksheet craig Excel Discussion (Misc queries) 1 May 25th 07 09:04 PM
Using Macro to sort without clicking on macro button dd Excel Discussion (Misc queries) 3 May 3rd 07 06:00 PM
Colour by clicking cell ronoee New Users to Excel 12 January 29th 07 12:07 AM
Run macro from clicking on a cell jrd269 Excel Discussion (Misc queries) 2 June 3rd 05 09:35 PM


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

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

About Us

"It's about Microsoft Excel"