Excel 2007, re-set cell value to empty

Bluesword

New Member
Joined
Mar 29, 2009
Messages
47
Can someone write a simple formula that I can plug into my spreadsheet? All I need is a simple formula that will empty cell data. I can modify it to cover various ranges if need be.
 

Some videos you may like

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.

Peter_SSs

MrExcel MVP, Moderator
Joined
May 28, 2005
Messages
47,926
Office Version
  1. 365
Platform
  1. Windows
Can someone write a simple formula that I can plug into my spreadsheet? All I need is a simple formula that will empty cell data. I can modify it to cover various ranges if need be.
Formula? or do you mean vba code?

vba examples:

Range("A1:D5").ClearContents
will leave formatting etc but remove value

Range("A1:D5").Clear
will remove everything
 

Bluesword

New Member
Joined
Mar 29, 2009
Messages
47
Let me ask you a question about the 'Range' command. How can I use this with several single cells not in a line, row or range?
 

Smitty

Legend
Joined
May 15, 2003
Messages
29,536
Welcome to the Board!

You can refer to the individual cells directly:

Range("A1, B2, A3, B4, A5").ClearContents

Hope that helps,
 

Bluesword

New Member
Joined
Mar 29, 2009
Messages
47

ADVERTISEMENT

Thanks Peter and Smitty, but I need someone to hold my hand on this. Now that I have the formula or Vba code, apparently there is a difference- I need to be able to install it into the spread sheet somehow. All I can do now is run the program from the macro editor.
 

Peter_SSs

MrExcel MVP, Moderator
Joined
May 28, 2005
Messages
47,926
Office Version
  1. 365
Platform
  1. Windows
Now that I have the formula or Vba code, apparently there is a difference-
There certainly is,

- a formula goes in a cell on your actual sheet and returns a value to that cell

- vba goes in a vba module, is triggered by some event, and may perform many different tasks.


I need to be able to install it into the spread sheet somehow.
Not exactly sure what you mean by that, but maybe I have answered that (at least partially) below.


All I can do now is run the program from the macro editor.
There are many ways you can get the code to run, including ...

- From the Developer ribbon (If you can't see the Developer ribbon then Office Icon|Excel Options...|Popular|Top options ...|Show Developer tab in the ribbon|OK) click Macros

- From the View ribbon choose Macros|View Macros

- You could add your macro to the Quick Access toolbar

- You could add a Command Button on your sheet to click to run the macro

- You could have the macro automatically run when a particular cell is changed (or even just selected)

- There are many more options as well.
 

Watch MrExcel Video

Forum statistics

Threads
1,123,104
Messages
5,599,746
Members
414,333
Latest member
willfrederick

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
Top