I need to run a macro when a user clicks in a certain cell.
e.g. When a user clicks in any cell, say any cell between cells c10 and c20, I would like to run a macro that I have already created.
I need to run a macro when a user clicks in a certain cell.
e.g. When a user clicks in any cell, say any cell between cells c10 and c20, I would like to run a macro that I have already created.
This macro works whenever cells C10 to C20 are selected. This could be by clicking, tabing etc
'To install macro to correct location
'Copy this macro
'GoTo Excel
'Select sheet this is to appy to
'Right Click on Sheet Name Tab > select View Code
'Past macro into the Worksheet Module displayed
Change MyMacro as required
![]()
Private Sub Worksheet_SelectionChange(ByVal Target As Range) If Not Application.Intersect(Target, Range("c10:c20")) Is Nothing Then Call Mymacro End If End Sub
Please Read Forum Rules Before Posting
Wrap VBA code by selecting the code and clicking the # icon or Read This
How To Cross Post politely
Top Excel links for beginners to Experts
If you are pleased with a member's answer then use the Scales icon to rate it
If my reply has assistedor failed to assist you
I welcome your Feedback.
Thank you - that works great!
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks