+ Reply to Thread
Results 1 to 5 of 5

Worksheet change AFTER selection change

  1. #1
    Forum Contributor
    Join Date
    11-10-2009
    Location
    Perth, Australia
    MS-Off Ver
    Excel 2007
    Posts
    549

    Worksheet change AFTER selection change

    I'm trying to fire a macro with selection changes.
    I've tried the two methods below (I think these are applicable with Class Modules).
    The first method gives me issues ... long story.
    The second method fires when a cell is selected. I want it to fire after I leave the cell. Is there any way to do this?

    Please Login or Register  to view this content.

  2. #2
    Forum Expert
    Join Date
    06-08-2012
    Location
    Left the forum!
    MS-Off Ver
    Left the forum!
    Posts
    5,189

    Re: Worksheet change AFTER selection change

    You would need to use a static variable declared a workbook (needs to be in a standard module) level to store the range of the previous cell.

    Set the varaible = activecell in a workbook open event and worksheet activate event.

    Set the variable = target at the end of your change / selection change code.

    Remember to use a command such as Intersect to compare the cell stored in the variable to the cells where it should run in order to prevent it misfiring.

  3. #3
    Forum Contributor
    Join Date
    11-10-2009
    Location
    Perth, Australia
    MS-Off Ver
    Excel 2007
    Posts
    549

    Re: Worksheet change AFTER selection change

    Thanks for responding. But how to do with code?

  4. #4
    Forum Expert
    Join Date
    06-08-2012
    Location
    Left the forum!
    MS-Off Ver
    Left the forum!
    Posts
    5,189

    Re: Worksheet change AFTER selection change

    In a standard module.
    Please Login or Register  to view this content.
    In the 'ThisWorkBook' module.
    Please Login or Register  to view this content.
    In the worksheet module.
    Please Login or Register  to view this content.
    At the start of your existing code (this is to run it only on A2:A100, change as needed).
    Please Login or Register  to view this content.
    At the end of your existing code (before End Sub)
    Please Login or Register  to view this content.
    You might need some changes / additions. That's best I can do with the information in your question.

  5. #5
    Forum Contributor
    Join Date
    11-10-2009
    Location
    Perth, Australia
    MS-Off Ver
    Excel 2007
    Posts
    549

    Re: Worksheet change AFTER selection change

    Thanks, this seems to have worked.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Worksheet Selection Change not working
    By Ochimus in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-24-2018, 04:20 AM
  2. Worksheet Selection change
    By c.davidson in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-12-2017, 07:30 AM
  3. How to Combine two Different Selection Change Events on One Worksheet
    By GSU1972 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-23-2016, 09:27 AM
  4. [SOLVED] Worksheet Selection change for many cells
    By Jamesera27 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-02-2015, 06:42 PM
  5. [SOLVED] WorkSheet Selection Change and Vlookup
    By coreytroy in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-29-2013, 09:55 PM
  6. Worksheet selection change
    By sigfreid in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-22-2011, 06:16 AM
  7. Worksheet Selection Change event not firing??
    By Simon Lloyd in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-21-2006, 10:29 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1