+ Reply to Thread
Results 1 to 9 of 9

Create a button to clear data in certain cells

  1. #1
    Registered User
    Join Date
    01-05-2008
    Posts
    12

    Create a button to clear data in certain cells

    I have several sheets where you fill in the same cells with data which needs to be cleared. Is there a button I can create to clear the data in a select group of cells so I don't have to manually click and delete each input cell? Thanks!
    - John

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689
    Cross-post: http://www.ozgrid.com/forum/showthread.php?t=82529

  3. #3
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Reopened. headbanger51 has agreed to the rules.

    headbanger51,

    What are the cells on each sht. Are there any sheets to ignore

    VBA Noob
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  4. #4
    Registered User
    Join Date
    01-05-2008
    Posts
    12
    There are several sheets and I would want to program the button to clear only the data on that particular sheet. There are a total of four sheets that I would like to have their individual button programmed for. The sheets are also protected so that the only data that can be entered is in the certain select cells...the ones I want the button to "refresh" or clear. I can include one of the sheets if that will help. Thanks!
    - John
    Last edited by headbanger51; 01-06-2008 at 03:23 PM.

  5. #5
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    What are the cells
    Still need to confirm the range. Is it a block of cells or individual cells

    VBA Noob

  6. #6
    Registered User
    Join Date
    01-05-2008
    Posts
    12
    Oh, sorry...they are indivdual cells. I've included one sheet as an example. The cells shaded in light yellow are the input cells that I would like cleared from a button.
    - John
    Attached Files Attached Files

  7. #7
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Sheets protected

    Change Password to your password

    Press Alt + F11 > insert module > paste in the below.

    See link for how to add buttons

    http://www.bettersolutions.com/excel...B926422321.htm

    Forms Button

    Please Login or Register  to view this content.
    HTH

    VBA Noob

  8. #8
    Registered User
    Join Date
    01-05-2008
    Posts
    12
    That worked like a champ. Unfortunately, it also opened a can of worms. I have several different sheets in my workbook and some sheets have different cells that need cleared. Other sheets within the workbook I would like to make it impossible to clear cells, as the button I created with this solution would, naturally, clear out the values of the cells on whichever sheet I had up. I'm continuing to research and "plug and chug" but I appreciate the help.
    - John

  9. #9
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,887
    Headbanger, perhaps something like the following might work:
    Please Login or Register  to view this content.
    Change your sheet names, ranges and password as needed.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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