Excel 2003 - clear button

G

Guest

I am making a spread sheet that will be used as a calculator. Each use
requires numerous entries. Is there a way to make a clear button (or another
method) that will simultaneously clear all of the entries from a previous
use? This spread sheet will also be used on Excel 97.
Thank you.
 
G

Guest

hi,
drop a command button on the sheet and put code in it similar to this.
Private Sub CommandButton1_Click()
Range("b2,b4,b6,d2,d4,d6").ClearContents
End Sub
you may have to removed my cells and add all of the cells you want to clear
on your sheet.

Regards
FSt1
 
G

Gord Dibben

F5>Special>Constants>OK

Edit>Cleat Contents.

You could record a macro whilst doing this and attach the macro to a button.


Gord Dibben MS Excel MVP
 
G

Guest

Thank you for your help. Could you help me again? I have 3 more questions.
1. After the cells are cleared, all of the cleared cells remain selected.
How do I modify the macro so that the only first cleared cell is selected
after all the cells are cleared?
2. When the workbook is opened a macro warning appears. Can the warning be
safely eliminated?
3. What is the difference between Sub and Private Sub?
Thank you.
 

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