+ Reply to Thread
Results 1 to 5 of 5

Formula to temporarily clear contents of cell when button is clicked..?

  1. #1
    Registered User
    Join Date
    01-19-2012
    Location
    TX
    MS-Off Ver
    Excel 2007 & Excel 2010
    Posts
    4

    Formula to temporarily clear contents of cell when button is clicked..?

    Hello,

    I would like to update my budget worksheet that uses a drop-down menu with a button instead for clearing contents of my cells.

    Currently I am using the formula =IF(F28="Yes","",D28) to clear the contents of a cell so I can show an item paid when "Yes" is selected from the drop down menu, and when I need to reset it for the next month I change the drop down menu to "No" and it defaults to the value of another cell.

    How can I utilize a button instead of having to keep using drop down menus? Would like to put in a button that changes color when activated and can be reset by clicking it again or a master button that will reset all buttons in a range...


    Thank you,

    JW

  2. #2
    Forum Expert José Augusto's Avatar
    Join Date
    10-29-2014
    Location
    Portugal
    MS-Off Ver
    2013-2016
    Posts
    3,329

    Re: Formula to temporarily clear contents of cell when button is clicked..?

    Hi
    Try this
    Select F2:F30
    Insert "No" in formula bar and press CTRL+ENTER

  3. #3
    Forum Expert ben_hensel's Avatar
    Join Date
    01-26-2012
    Location
    Northeast USA
    MS-Off Ver
    Office 365
    Posts
    2,043

    Re: Formula to temporarily clear contents of cell when button is clicked..?

    You mean a VBA entity or do you want to keep away from XLSM files?
    Click the [* Add Reputation] Button to thank people for help!
    Post Attachment: Click [Go Advanced] under the reply box; then click [Manage Attachments] to launch the attachments dialogue.
    Mark Thread Solved: Go to the top of the first post; Select [Thread Tools] dropdown; Pick the [Mark thread as Solved] option.

  4. #4
    Registered User
    Join Date
    01-19-2012
    Location
    TX
    MS-Off Ver
    Excel 2007 & Excel 2010
    Posts
    4

    Re: Formula to temporarily clear contents of cell when button is clicked..?

    Either way, whichever is easiest.

    All I have been able to do so far is go to developer tab -> insert -> button (form control), and is as far as I have got.

    Thanks,

  5. #5
    Registered User
    Join Date
    01-19-2012
    Location
    TX
    MS-Off Ver
    Excel 2007 & Excel 2010
    Posts
    4

    Re: Formula to temporarily clear contents of cell when button is clicked..?

    Ok, seems I got it to work. Here's the code I came up with. However, can I get some help with resetting the value of the buttons in range from E8:E16 back to default (false) by having another button to "reset" them?

    Private Sub ToggleButton1_Click()
    If ToggleButton1.Value = True Then
    Range("c9").Value = ""
    Else
    Range("c9").Value = Range("d9").Value
    End If
    End Sub

+ 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. Clear merged cell contents in comand button(clear all)
    By mohan_984 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 08-25-2015, 10:39 AM
  2. [SOLVED] Using command button to copy cell contents and paste to different sheet, then clear cells
    By Ethanrholt in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 07-24-2015, 10:20 AM
  3. [SOLVED] If cell contains formula then not clear contents problem
    By mso3 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-03-2014, 02:36 AM
  4. Running a cell formula only when a button is clicked
    By helen269 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-23-2012, 01:51 PM
  5. How to clear formula without clearing cell contents
    By prayami in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-03-2008, 04:33 AM
  6. clear cell contents if not a formula
    By pimar in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-28-2006, 10:03 AM
  7. Clear cell contents with a button
    By KFC / A&W Boy in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-07-2005, 06:06 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