+ Reply to Thread
Results 1 to 4 of 4

Adjust VBA Code to Run Only When Cells in Certain Range are Changed

  1. #1
    Registered User
    Join Date
    02-10-2014
    Location
    Southern CA
    MS-Off Ver
    Excel 2003
    Posts
    7

    Adjust VBA Code to Run Only When Cells in Certain Range are Changed

    Hey everyone - first time poster here.

    I've managed to piece together a VBA code that works perfectly for my needs. The problem is that the sheet it is on gets adjusted a lot, and I only need the code to run when certain cells are changed (rather than each time any cell is changed).

    Here is the code I have now:

    Please Login or Register  to view this content.
    Put simply, I need this code to run only when a cell in Range "TValueDeal" is changed. Is making this adjustment as simple as adding a couple lines of code, or is there a better way to write the entire thing?

    Thanks for your help.

  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: Adjust VBA Code to Run Only When Cells in Certain Range are Changed

    Replace your worksheet_calculate routine with:

    Please Login or Register  to view this content.
    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
    02-10-2014
    Location
    Southern CA
    MS-Off Ver
    Excel 2003
    Posts
    7

    Re: Adjust VBA Code to Run Only When Cells in Certain Range are Changed

    Perfect - thank you for the quick reply!

  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: Adjust VBA Code to Run Only When Cells in Certain Range are Changed

    You're welcome - glad it solved your problem, thanks for the feedback

+ 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. Adjust Code to Loop through Visible(filtered) cells only
    By enidnunez in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-19-2013, 09:23 AM
  2. VBA code to calculate only changed range of cells
    By Johnmus in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-19-2013, 10:24 PM
  3. Limit to apply code only when certain cells are changed
    By kwengerd in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-24-2011, 05:11 PM
  4. Range variable doen't adjust to moving cells between sheets
    By gvz2009 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-03-2009, 11:45 AM
  5. Retrieve individual cells from a range changed between a range
    By baldomero in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-05-2005, 02:31 PM

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