Excel 2016 Adding a Clear Form Button

Поделиться
HTML-код
  • Опубликовано: 5 сен 2016
  • Learn how add a clear form button to an Excel sheet. The button will allow you to clear input in order re-set the sheet to its original state.

Комментарии • 18

  • @powerstats7613
    @powerstats7613 5 лет назад

    Thank you - great tutorial! Appreciate it

  • @johnwortman7624
    @johnwortman7624 2 года назад

    Life Saver!!!! GREAT instructions!!! Easy to follow!!

  • @holgerrode7014
    @holgerrode7014 4 месяца назад

    I have a bug, as my sheet only clears the first line and the code doesn't make it to the second clear line, and it doesn't print the MsgBox to the screen. Any suggestions on what I need to do?

  • @tavinorigami
    @tavinorigami 6 лет назад

    thank you worked like a charm, it is usefull if the code is in the descriptio or in a Comment.
    so here you go
    Private Sub NameOfYourButton_Click()
    Sheets("NameOfSheet").Range("A1:A1").Value = ""
    MsgBox "form cleared"
    End Sub

  • @woggershomeservices9949
    @woggershomeservices9949 4 года назад

    My Clear Form button is also clearing the Conditional Formatting in some of the cells. Some cells I have highlighted when they're blank and once data is entered in the cell the highlighting goes away. When I hit my Clear Form button the data in the cells clears as it should but many of the cells don't go back to being highlighted. If i click in those cells and hit Delete then the cell highlights again, so it's acting as though there's still data in the cell after I hit the Clear Form button. Why do only some cells do this? I've tried reformatting the cells, clearing and re-entering the Conditional Formatting, clearing and re-entering the code for the Form Clear button, and even to the point where I've cleared all formatting from those cells, recreated the cell and added the Conditional Formatting, but the same thing happens to the same cells over and over, no matter what I do. Any thoughts on why this is happening?

    • @DrRyanPhelps
      @DrRyanPhelps  4 года назад

      Sounds like a glitch. I would check on the forums.

  • @albertnoga6920
    @albertnoga6920 5 лет назад

    hello. how do we reset selected radio buttons in a box (excel)? thank you so much

    • @DrRyanPhelps
      @DrRyanPhelps  5 лет назад +1

      If you have the radio button linked to a cell (right click > Format Control > Cell Link) , then you can simply clear the linked cell.

    • @albertnoga6920
      @albertnoga6920 5 лет назад

      DrRyanPhelps thank you so much . It’s a great help

  • @jbkregs2766
    @jbkregs2766 4 года назад

    This is awesome. Is there a code to add a safety so it can’t be deleted by accident? For example, it won’t clear until you click on the “ok” in the msg box.

    • @DrRyanPhelps
      @DrRyanPhelps  4 года назад +2

      Add this below the first line of code.
      If MsgBox("This will erase everything! Are you sure?", vbYesNo) = vbNo Then Exit Sub
      Thanks for the great question. I have tested this.
      Link to author:
      stackoverflow.com/questions/8569389/add-are-you-sure-to-my-excel-button-how-can-i

    • @jbkregs2766
      @jbkregs2766 4 года назад

      Thank you so much for your help!!

    • @DrRyanPhelps
      @DrRyanPhelps  Год назад

      My pleasure!

  • @lakshmikruthiga7699
    @lakshmikruthiga7699 5 лет назад

    Sir, can you please tell me where I can learn about excel VB and macros online for free.

    • @DrRyanPhelps
      @DrRyanPhelps  5 лет назад

      Unfortunately, I do not know where you can find that. You may be able to get an old textbook on the cheap.

  • @wayneseymour1
    @wayneseymour1 4 года назад

    have a calculation that I would like to put into excel if not in the vba form then make it do the calculation on the spread sheet once I have sent the day to the sheet the calculation is for determining the productivity rate of a excavator it looks like this:
    3600s / hr x 3 cy x.85 divided by 20.S' / cycle X 50min/60min X 1/(1+35) the answer is 283.bcy/hr but I dont know how to write it in excel or vba

    • @DrRyanPhelps
      @DrRyanPhelps  4 года назад

      You may find some help here: ruclips.net/video/9S05gvRXyZw/видео.html