Adding a Clear Field Button to an excel file?

  • Thread starter Thread starter Legacy 50109
  • Start date Start date
L

Legacy 50109

Guest
Not too familiar with visual basics, and I believe its possible.

I have an excel file that will be used on a constant basis for some basic calculations.

Does anyone know how to add a "Clear Field" button to an excel file?

It would be about 2-3 fields that would require constant data entry and needs to be cleared each time, with the click of a button.

Thanks,
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
I know I'm kind of new, but it didn't work?

Am I doing something wrong?

I changed the value to correspond with the cells I want cleared, but how to I create the "clear button".

Thanks,
 
Upvote 0
Selects will lead to troubles :warning: ... here's the above macro cleaned up :wink:

Code:
Sub clearV2()
    Range("D43,D44,D45").ClearContents
End Sub

Once you've got the macro running you can create a ShortCut-Key to it by going to Tools..Macro..Macros... and clicking on the "Options" button.
 
Upvote 0

Forum statistics

Threads
1,224,386
Messages
6,178,290
Members
452,836
Latest member
knoharra

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top