Run Macro on Mouse Click

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Is is possible to run a macro that displays a pre-set number upon clicking in
a cell?
For example: everytime someone needs to see the value 24 in cell b4 all they
have to do is click in that cell to make that number visible.
Thank you
 
Is is possible to run a macro that displays a pre-set number upon clicking in
a cell?
For example: everytime someone needs to see the value 24 in cell b4 all they
have to do is click in that cell to make that number visible.
Thank you

The following in the Worksheet Selection Change event should do the
trick


Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Not Intersect(Target, Range("B4")) Is Nothing Then Range("B4")
="24"

End Sub

HTH

__
Richard Buttrey
Grappenhall, Cheshire, UK
__________________________
 
Thank you! I appreciate it!

Richard Buttrey said:
The following in the Worksheet Selection Change event should do the
trick


Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Not Intersect(Target, Range("B4")) Is Nothing Then Range("B4")
="24"

End Sub

HTH

__
Richard Buttrey
Grappenhall, Cheshire, UK
__________________________
 
I am working in Excel version 2000. Is Worksheet Selection Change event in
there?
 
It's in all Excel since Excel 97.

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)
 
Thanks

Bob Phillips said:
It's in all Excel since Excel 97.

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)
 
I have been searching in Excel to find this function for words like it in the
function drop down lists. Do you know where it is? When used help I found
worksheet_function but not worksheet_selection change.
 
Just lookup SelectionChange

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)
 
Tried that and other variations but it was not found in Excel help. Any other
ideas? SelectionChange is not in my help index. Are we positive its in Excel
2000 or maybe its in Excel 2000 but under another term?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top