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.
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
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
 
Upvote 0
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?
 
Upvote 0
Welcome to the Board!

You can refer to the individual cells directly:

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

Hope that helps,
 
Upvote 0
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.
 
Upvote 0
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.
 
Upvote 0

Forum statistics

Threads
1,213,536
Messages
6,114,215
Members
448,554
Latest member
Gleisner2

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