+ Reply to Thread
Results 1 to 6 of 6

Macro to change the value of a cell based on another cell value

  1. #1
    Registered User
    Join Date
    05-09-2019
    Location
    Aberdeenshire
    MS-Off Ver
    office 16
    Posts
    3

    Macro to change the value of a cell based on another cell value

    Hi all, I'm new the forum and looking for some help please.

    Up until now i have managed to get by with google searches but my latest problem i just cant seem to find a resolve.

    I have a worksheet that i use to track progress of activities based on a tick "a", I currently have a code set up so that when i double click the 100% cell an "a" is inserted in the cell and i have a simple formula =IF(AA6="a","a","") to populate the 90% then 80% etc to save double clicking each increment, the reason for the double click is i update the progress on a large touch screen TV.

    Capture.JPG

    the problem now is i have thousands of cells with the formula above and it takes a long time to calculate.

    what i would like to achieve is when any percentage is double clicked the percentages up to that auto populates with an "a".

    any help would be greatly appreciated.
    Last edited by rbowie1980; 05-09-2019 at 06:50 AM.

  2. #2
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,821

    Re: Macro to change the value of a cell based on another cell value

    It sounds like you are currently using a Worksheet_BeforeDoubleClick macro to insert the "a". Replace your current macro in the worksheet code module with the one below. You will not need any formulas.
    Please Login or Register  to view this content.
    You can say "THANK YOU" for help received by clicking the Star symbol at the bottom left of the helper's post.
    Practice makes perfect. I'm very far from perfect so I'm still practising.

  3. #3
    Registered User
    Join Date
    05-09-2019
    Location
    Aberdeenshire
    MS-Off Ver
    office 16
    Posts
    3

    Re: Macro to change the value of a cell based on another cell value

    Thank you very much, works great. not wrapped my head round why though

    can i push my luck and ask would it it be possible to remove the "a" using the double click in the event an activity was progressed wrongly?

  4. #4
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,821

    Re: Macro to change the value of a cell based on another cell value

    Replace the current macro with these two. Double click to add the "a" and simply delete the "a" furthest to the right to clear all the a's in that row.
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    05-09-2019
    Location
    Aberdeenshire
    MS-Off Ver
    office 16
    Posts
    3

    Re: Macro to change the value of a cell based on another cell value

    That will do nicely, Thanks again

  6. #6
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,821

    Re: Macro to change the value of a cell based on another cell value

    You are very welcome. Actually, you can use the double click both to populate the range with "a" and to delete them when you double click again. Replace the previous two macros with this one:
    Please Login or Register  to view this content.

+ 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. Formula Macro to change cell value based on another cell
    By cobrien64 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-02-2016, 06:29 AM
  2. Macro to Change Text Color to Red in Cell Based of Cell Value in Another Worksheet
    By jriemanx2 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-18-2016, 11:09 AM
  3. Using Macro to change cell color based on reference cell value in different sheet
    By Emma Ford in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-09-2015, 03:51 AM
  4. Macro to change colour of cell based on finding a specific word in the cell
    By Shelby761 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-24-2014, 09:46 AM
  5. Macro to change cell contents based on another cell in the same row
    By lanos in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-27-2012, 10:11 AM
  6. [SOLVED] Macro to change values of a cell based off another cell
    By krazyjoker in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 06-27-2012, 12:45 AM
  7. Macro to Enter Text in Cell B based on Change in Cell A?
    By kaletag in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-19-2012, 11:59 AM

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