+ Reply to Thread
Results 1 to 6 of 6

running a macro when a cell changes

  1. #1
    Forum Contributor
    Join Date
    05-28-2016
    Location
    Australia
    MS-Off Ver
    2013
    Posts
    119

    running a macro when a cell changes

    I am searching for code to run a specific macro when i change the data in a particular cell.
    I am already running a Private Sub Worksheet_Change code on the sheet and when i add another, i get errors.

    This is what i have now and do not want to remove.
    Formula: copy to clipboard
    Please Login or Register  to view this content.



    This is the type of thing found on an internet search which when added to the above code causes a runtime error.
    [Range(FindDate) represents the cell i called FindDate which when changed I want to run the Macro called FindSelectedDate]

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    How can i achieve this please?

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,644

    Re: running a macro when a cell changes

    How exactly did you add that to the existing code?
    If posting code please use code tags, see here.

  3. #3
    Forum Contributor
    Join Date
    05-28-2016
    Location
    Australia
    MS-Off Ver
    2013
    Posts
    119

    Re: running a macro when a cell changes

    I simply pasted it into VBA. (see below)

    I did try adding just the If Not Intersect(Target, Range(FindDate)) Is Nothing Then FindSelectedDate before the End Sub but of course it failed too.


    Formula: copy to clipboard
    Please Login or Register  to view this content.

  4. #4
    Forum Expert skywriter's Avatar
    Join Date
    06-09-2014
    Location
    USA
    MS-Off Ver
    365 Version 2409
    Posts
    2,789

    Re: running a macro when a cell changes

    When you have a named range you must use quotes around the name.
    Maybe this will work for you.
    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    05-28-2016
    Location
    Australia
    MS-Off Ver
    2013
    Posts
    119

    Thumbs up Re: running a macro when a cell changes

    You are a legend, thank you so much.

  6. #6
    Forum Expert skywriter's Avatar
    Join Date
    06-09-2014
    Location
    USA
    MS-Off Ver
    365 Version 2409
    Posts
    2,789

    Re: running a macro when a cell changes

    My pleasure, thanks for the feedback and rep. points.

+ 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. Replies: 2
    Last Post: 03-16-2017, 06:49 AM
  2. Replies: 2
    Last Post: 05-09-2016, 12:41 PM
  3. [SOLVED] Running macro when cell changes?
    By steamsoda in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-05-2014, 12:40 AM
  4. [SOLVED] Macro for running a macro when any cell in a range of cells changes
    By gm2612 in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 12-27-2013, 11:36 PM
  5. Macro Cell Error At Cell message when running Solver in VBA
    By Eharr3 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-15-2013, 03:36 PM
  6. Replies: 2
    Last Post: 06-03-2012, 03:33 PM
  7. running a macro when a certain cell changes
    By Jeffreak in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-06-2005, 10:09 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