I would like to link a macro to a specific cell (rather than an object) in Excel 2007. When you click on that cell, I would like the macro to run. Is this possible?
I would like to link a macro to a specific cell (rather than an object) in Excel 2007. When you click on that cell, I would like the macro to run. Is this possible?
max67,
In the appropriate sheet code module:
![]()
Private Sub Worksheet_SelectionChange(ByVal Target As Range) If Target.Address = "$A$1" Then '''''''''''''''''''''' ' ' ' Your code here ' ' ' '''''''''''''''''''''' End If End Sub
Hope that helps,
~tigeravatar
Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble
If VB is the only option (and I'm not the best with VB), can you provide additional detail? I'd like to click on cell G1 and then run the macro I've named "Filter2012".
![]()
Private Sub Worksheet_SelectionChange(ByVal Target As Range) If Target.Address = "$A$1" Then Application.EnableEvents = False Call Filter2012 Application.EnableEvents = True End If End Sub
That worked perfectly. Thank you!
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks