Easy one. How do I activate a macro if ActiveCell changes?

Hi,

I am sure this is easy!

Let's say I am in any cell of a sheet.

I want to run macro1 if I move to any other cell.

I.e. if I move cell at all - I want to run macro1

How do I do this?
Patrick O'DeaAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
Martin LissConnect With a Mentor Older than dirtCommented:
Call the macro in the Worksheet_SelectionChange event.
0
 
Tony GiangrecoConnect With a Mentor Commented:
0
 
Saqib Husain, SyedConnect With a Mentor EngineerCommented:
Right-click on the sheet tab name
Select view code
in the first dropdown above the code pane select worksheet
in the second dropdown above the code pane select selectionchange

now place your code there.
0
 
Patrick O'DeaAuthor Commented:
Thanks all!
0
 
Saqib Husain, SyedEngineerCommented:
The above sequence will work for only that particular worksheet.

If you want this to happen in any worksheet of a given workbook then from that workbook
goto the vba window
double-click on the workbook module
in the first dropdown above the code pane select workbook
in the second dropdown above the code pane select sheetselectionchange
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.