Starting a Macro from the worksheet...

SpiderMoon

Board Regular
Joined
Apr 4, 2005
Messages
77
I am wondering how I would do this...

I would like to start a macro whenever I enter a particular column on sheet 1. Except I am not sure how I would do this. Is this even possible? :unsure:
 

Some videos you may like

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest

Norie

Well-known Member
Joined
Apr 28, 2004
Messages
76,047
Office Version
  1. 365
Platform
  1. Windows
Well it sounds to me what you want is a worksheet SelectionChange event.

The following will run whenever column A is selected.
Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    If Target.Column = 1 Then ' check for column A
        MsgBox "You've selected column A"
        ' code to run macro
    End If
End Sub
 

Watch MrExcel Video

Forum statistics

Threads
1,118,056
Messages
5,569,953
Members
412,299
Latest member
agentless
Top