Solved

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

Posted on 2014-04-20
5
138 Views
Last Modified: 2014-04-20
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?
0
Comment
Question by:Patrick O'Dea
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 25

Assisted Solution

by:Tony Giangreco
Tony Giangreco earned 100 total points
ID: 40011472
0
 
LVL 47

Accepted Solution

by:
Martin Liss earned 200 total points
ID: 40011477
Call the macro in the Worksheet_SelectionChange event.
0
 
LVL 43

Assisted Solution

by:Saqib Husain, Syed
Saqib Husain, Syed earned 200 total points
ID: 40011485
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
 

Author Closing Comment

by:Patrick O'Dea
ID: 40011486
Thanks all!
0
 
LVL 43

Expert Comment

by:Saqib Husain, Syed
ID: 40011487
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

Featured Post

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
Freeze panes is an option within all variants of Excel to enable parts of a sheet to remain stationary when the cursor is in another part of the sheet. This is a very useful feature which is overlooked or under used.
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.
This Micro Tutorial will demonstrate how to create pivot charts out of a data set. I also added a drop-down menu which allows to choose from different categories in the data set and the chart will automatically update.

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question