+ Reply to Thread
Results 1 to 6 of 6

Macro to Modify cell values

  1. #1
    Forum Contributor leo73pk's Avatar
    Join Date
    09-28-2006
    Location
    UAE
    MS-Off Ver
    2016, Microsoft 365
    Posts
    294

    Macro to Modify cell values

    In the attached workbook sheet 1 have different formulas in different cells. (Present State of sheet 1)

    I just want to automate worksheet through a macro that If Cell Value in Sheet 1, Cell P2=2, then formulas in the following cell ranges convert into absolute values:

    R5:R7, T5:T7, V5:AA7, R12:R14, T12:T14, V12:AA14

    and subsequently, when I change the Cell Value in Sheet 1, Cell P2=1, the absolute values convert into formulas which are currently in present state of sheet 1 above referred cell ranges .
    Attached Files Attached Files
    Last edited by leo73pk; 02-19-2022 at 05:35 AM.
    Best Regards,
    Hamza


    It is the greatest of all mistakes to do nothing because you can only do little - do what you can.

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Macro to Modify cell values

    Here's one way in the Sheet change event procedure

    Please Login or Register  to view this content.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Forum Contributor leo73pk's Avatar
    Join Date
    09-28-2006
    Location
    UAE
    MS-Off Ver
    2016, Microsoft 365
    Posts
    294

    Re: Macro to Modify cell values

    Thanks Richard,

    your proposed macro works, but I have to convert multiple cell ranges, wherein formulas are defined, into values in my actual workbook. Therefore, I would like to use following approach, but i'm making some mistake in coding to achieve the desired results. I'll appreciate if you can help me to modify below mentioned macro to get the desired results.
    Please Login or Register  to view this content.
    Last edited by AliGW; 02-19-2022 at 03:09 PM. Reason: Quote tags changed to code tags.

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2505 (Windows 11 Home 24H2 64-bit)
    Posts
    91,301

    Re: Macro to Modify cell values

    Administrative Note:

    We would very much like to help you with your query, however you need to include code tags around your code.

    Please take a moment to add the tags. Posting code between [code]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/code] tags makes your code much easier to read and copy for testing, and it also maintains VBA formatting.

    Please see Forum Rule #2 about code tags and adjust accordingly. Click on Edit to open your post, then highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here

    (Note: this change is not optional. No help to be offered until this moderation request has been fulfilled.)
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

  5. #5
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2505 (Windows 11 Home 24H2 64-bit)
    Posts
    91,301

    Re: Macro to Modify cell values

    Thank you.

  6. #6
    Forum Contributor leo73pk's Avatar
    Join Date
    09-28-2006
    Location
    UAE
    MS-Off Ver
    2016, Microsoft 365
    Posts
    294

    Re: Macro to Modify cell values

    You are welcome. Thanks for reminding me.

+ 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] Converting formula to values
    By Dingo666 in forum Excel General
    Replies: 2
    Last Post: 02-22-2019, 03:00 PM
  2. Replies: 1
    Last Post: 04-13-2017, 08:59 PM
  3. Formula for converting all values plugged in automatically
    By Jose-S in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 01-10-2013, 12:10 PM
  4. Excel macro converting values to text
    By JoeNK in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-27-2012, 01:41 PM
  5. [SOLVED] Converting text array to values in a formula
    By weeble33 in forum Excel General
    Replies: 4
    Last Post: 07-17-2012, 01:34 PM
  6. [SOLVED] Converting formula to values automatically
    By Heems in forum Excel General
    Replies: 5
    Last Post: 05-25-2012, 10:58 AM
  7. converting formulas into values using a macro in visual basic edit
    By F.C in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-28-2005, 05:05 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