Solved

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

Posted on 2014-04-20
5
132 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
5 Comments
 
LVL 25

Assisted Solution

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

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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Suggested Solutions

Approximate matching with VLOOKUP and MATCH seems to me to be a greatly under-used technique, and one which is vital for getting good performance out of large lookups. Until recently I would always have advised using an exact match for simplicity an…
This code takes an Excel list of URL’s and adds a header titled “URL List”. It then searches through all URL’s in column “A”, looking for duplicates. When a duplicate is found, it is moved to the top of the list. The duplicate URL’s are then highlig…
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.

747 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now