Command button to clear inputs

M

mbing916

Could you help me with the macro so I could assign a button to clear inputs?
Is there a place to go to look up different macros? I don't have much
experience with this and it is hard to know what to put so the macro will
work.

Thanks!
 
T

tim m

You could record a macro by going 'tools'....'macro'....'record new macro'
and manually delete the data from the cells you want it gone from. When you
have made the last deletion stop the macro and assign it to a key or create a
button and assign the macro to the button.
 
G

Gord Dibben

You need to supply some more details to get anything other than a few guesses.

What "inputs" need to be cleared and when?

Sub Clearit()
Selction.ClearContents
End Sub

Will clear all data from the selected cells.

The Delete key will do the same thing.

Why do you think you need a macro?


Gord Dibben MS Excel MVP
 
R

Ron de Bruin

Typo Alert
Selction.ClearContents
Selection.ClearContents

For the OP
If you select the cells you want to clear with the CTRL key down you can give the cells a name with Ctrl-F3.

After that you can use
Range("YourRangeName").ClearContents
 
M

mbing916

I am trying to set up an application and price quote forms as part of a
workbook. I would like the clear inputs button so all the cells that have
had data entered can be cleared at once vs. manually deleted since the
workbook will be used for multiple customers.
 
G

Gord Dibben

Follow Ron's advice and create named ranges then run his code to delete values
from each named range you choose.


Gord
 
M

mbing916

Thanks for all the tips! I got it to work.

Ron de Bruin said:
Typo Alert

Selection.ClearContents

For the OP
If you select the cells you want to clear with the CTRL key down you can give the cells a name with Ctrl-F3.

After that you can use
Range("YourRangeName").ClearContents
 
Top