Clear fields

J

jakecarey

Is there a way to have a button on the spreadsheet that will clear al
selected cells? this would be very nice in a form I would like t
create for some banking issues we have.

Jak
 
P

Paul B

Jack, you could use this and assign it to a button,
Selection.ClearContents
or you could put the cells you want to clear in the code like this
Sheet1.Range("A1,A4,A7,D1,E5,G9,I14").ClearContents

--
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 2000 & 2003
** remove news from my email address to reply by email **
 
R

Ron de Bruin

You can use this

Selection.Clear ' also the formatting

Or

Selection.ClearContents
 
G

Gord Dibben

Jake

Select the cells then right-click and "Clear Contents".

OR

Tools>Customize>Commands>Edit. Scroll down to "Clear Contents" button and
drag it up to your toolbar. This would not follow the workbook if others used
the workbook.

OR if you want to add a button to your worksheet and assign a macro.
Copy/paste the macro below to a general module in your workbook.

Sub ClearOut()
Selection.ClearContents
End Sub

Open the Forms Toolbar and click on the button tool. Draw a button on your
sheet and right-click "assign macro". This would be saved with and follow the
workbook.

Gord Dibben Excel MVP
 
D

Debra Dalgleish

Choose Tools>Customize
Select the Command tab
Select the Edit category
In the list of commands, scroll down to find Clear Contents
Drag it to an existing toolbar
There's also an "All" button, which clears everything from a cell
and a Clear Formatting button
Close the Customize dialog box
 
J

jakecarey

I guess I don't understand how to do it. It will not let me record
standar macro, it takes me to visual basic everytime.

I would be willing to e-mail the form to someone if they could set th
button for me.

Jak
 
G

Gord Dibben

jake

If you're still having trouble with this send me your workbook.

Change the <AT> and the <DOT>

Gord Dibben Excel MVP
 
D

davidmg1

I've used the "Clear Contents" button and right click, but I just wan
to clear the data I've inputed, not the formulas.

Whenever I use "Clear Contents", it erases both.

I would like to make a button to do this if possible.

Thank you
 
G

Gord Dibben

To clear out data but not formulas........

CRTL + A to select all cells.

F5>Special>Constants. Choose from the options which constants you wish to
select then OK.

Now with the constants selected Edit>Clear>Contents

Your formulas will remain ready for new data.

Gord Dibben Excel MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top