Resetting cells to zero value.
I have this same problem only i want to "0" only a few cells here and there
on about 1500 rows. Is there a way of only zeroing certain cells easily.
Telling a macro to "0" only highlighted cells?
"Dave Peterson" wrote:
Select the 250 cells you want to reset to 0.
Hit alt-f11 to get to the VBE
hit ctrl-g to see the immediate window
Selection.name = "ClearThemAll"
and hit enter
Now back to excel select any cell.
Start recording a macro.
(to fill all the selected cells with 0)
stop recording the macro (or select another cell first if you want).
You could modify the code to eliminate some of the .select's. And maybe even
add a prompt (are you sure?).
Dim Resp As Long
Resp = MsgBox(prompt:="Are you sure you want to reset the values", _
If Resp = vbYes Then
ActiveSheet.Range("ClearThemAll").Value = 0
Then show the Forms toolbar. Drag a button from this toolbar (not the control
toolbox toolbar) to the worksheet. (Change the caption!)
And assign this macro to the button.
I have lots of cells with numbers. Can I place a button that will reset all
cells to zero?
Right now, when I want to start over, I go to each cell and change it to
zero. I have 250 cells.
Thank you if you can help with this.