+ Reply to Thread
Results 1 to 5 of 5

Use a checkbox to erase a cell's formula

  1. #1
    Registered User
    Join Date
    02-19-2020
    Location
    Quebec, Canada
    MS-Off Ver
    2019 office pro, mac
    Posts
    4

    Use a checkbox to erase a cell's formula

    Hi,

    I want to create a checkbox which when checked would delete the fomula that is already in a cell and therefore would allow manual changes. I did some research and couldn't find anything. Do you have any ideas on how to program something like this?

    Best regards,

    Matt

  2. #2
    Valued Forum Contributor PaulSP8's Avatar
    Join Date
    11-21-2017
    Location
    Chorley, England
    MS-Off Ver
    2013 & 2021
    Posts
    437

    Re: Use a checkbox to erase a cell's formula

    Not really sure why you'd want to do that when you can just overwrite it, but...

    I've attached an example workbook - The Checkbox toggles the formula in B1

    The code for it lies in the Sheet1 code - If you check the box, it deletes it, if you uncheck it, it puts it back to give you both examples;

    Please Login or Register  to view this content.
    Hope that helps.
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    02-19-2020
    Location
    Quebec, Canada
    MS-Off Ver
    2019 office pro, mac
    Posts
    4

    Re: Use a checkbox to erase a cell's formula

    I'm new to VBA coding, so I don't fully grasp your hole code. I copy pasted what you did on a new worksheet and linked a checkbox to B1, but the result that I got was "TRUE" and "FALSE". Do you know what my mistake is?

  4. #4
    Forum Contributor
    Join Date
    10-30-2019
    Location
    Bistrita, Romania
    MS-Off Ver
    2019; 365
    Posts
    231

    Re: Use a checkbox to erase a cell's formula

    It would help if you would attach the workbook you used to show us what you did and where the mistake was.
    To show your appreciation
    Click ★ Add reputation!

  5. #5
    Valued Forum Contributor PaulSP8's Avatar
    Join Date
    11-21-2017
    Location
    Chorley, England
    MS-Off Ver
    2013 & 2021
    Posts
    437

    Re: Use a checkbox to erase a cell's formula

    Quote Originally Posted by Timat124 View Post
    I copy pasted what you did on a new worksheet and linked a checkbox to B1, but the result that I got was "TRUE" and "FALSE". Do you know what my mistake is?
    You need to assign it to a Macro, right click on the Checkbox and then 'Assign Macro' - Don't worry about setting the control value for this one.

+ 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] Erase Value in Adjacent Cell
    By redrocker12 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-11-2018, 02:23 PM
  2. [SOLVED] Erase space in a cell
    By Saturn in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-28-2017, 10:57 AM
  3. [SOLVED] How to erase the name of a cell using macros?
    By luisfmb in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-11-2014, 12:41 PM
  4. [SOLVED] button erase dont erase an image inserted on an image control
    By Nuno Neves in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-11-2014, 08:04 AM
  5. [SOLVED] Erase the content of cells with a particular formula
    By Saturn in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 02-06-2014, 04:03 PM
  6. [SOLVED] Erase cell that are unprotect AND not in the first row.
    By Melisendk in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-11-2013, 02:34 AM
  7. Erase data, preserve formula's
    By urbanfox in forum Excel General
    Replies: 3
    Last Post: 03-04-2006, 05:30 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