+ Reply to Thread
Results 1 to 4 of 4

Macro to run when cell value changes,

  1. #1
    Registered User
    Join Date
    08-18-2014
    Location
    London
    MS-Off Ver
    2013
    Posts
    16

    Macro to run when cell value changes,

    I want a macro to run when a cell value changes, which is straight forward. However i want the macro to use the value which was in the cell prior to it changing, is this possible??

  2. #2
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: Macro to run when cell value changes,

    You don't explain what you want to do with the previous value...

    But try something like this in your worksheet module:

    Please Login or Register  to view this content.
    Obviously, change the worksheet_change event code to suit your needs, but it shows how you can use the previous cell value.
    let Source = #table({"Question","Thread", "User"},{{"Answered","Mark Solved", "Add Reputation"}}) in Source

    If I give you Power Query (Get & Transform Data) code, and you don't know what to do with it, then CLICK HERE

    Walking the tightrope between genius and eejit...

  3. #3
    Registered User
    Join Date
    08-18-2014
    Location
    London
    MS-Off Ver
    2013
    Posts
    16

    Re: Macro to run when cell value changes,

    Thanks for the reply, i should of probably explained myself a bit better.
    So i essentially will have a copy of worksheet, though the values in this duplicate will have the cell value before a cell value is changed in the original worksheet.

  4. #4
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: Macro to run when cell value changes,

    If anything, that explanation made it less clear.

    Does my code not do what you want? if not - then try posting a workbook to explain your requirement more clearly. Attach a sample workbook. Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and use the paperclip icon to open the upload window.

    View Pic

+ 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] Macro Delete Contents in 23rd corresponding cell if the cell in range is a non-blank cell
    By murtaza.khan in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 03-04-2014, 01:11 AM
  2. macro to run a macro for evrey cell in column depending upon valuein cell
    By swaptul in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-09-2014, 06:55 PM
  3. If cell contains text string then run macro, otherwise stop macro and popup message
    By justindk in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-15-2014, 08:20 AM
  4. Replies: 1
    Last Post: 11-06-2013, 02:56 AM
  5. Cell Rounding Macro - significant digits is variable from cell to cell
    By schmidt62 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-04-2012, 05:06 PM

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