Add Code Clear Cancel Command Buttons on User Form

Add and Code the Clear and Cancel Command Buttons on a UserForm
Today we learn how to add and code for the clear and cancel command buttons on our userform to make it more user-friendly and thereby reduce errors during data entry and improve our productivity. Also if we run the macro by mistake we can cancel the process in a more intuitive manner.
The code for all the three command buttons is given below and you’ll also notice that we have used a ‘for loop’ to clear the data from the textbox and combobox controls.
Let’s watch the video below to understand the complete process of adding and coding the new controls.

Try this:
For Each ctl In Me.Controls
Hopefully your UserForm name is ‘bill_generator’
By the way I ran your code on my computer and it worked perfectly! The user-form name in the code must be 100% correct.