Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2014-04-20
5
Medium Priority
?
143 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 400 total points
ID: 40011472
0
 
LVL 49

Accepted Solution

by:
Martin Liss earned 800 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 800 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
After seeing numerous questions for Dynamic Data Validation I notice that most have used Visual Basic to solve the problem. This suggestion is purely formula based and can be used in multiple rows.
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.

604 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