Need VBA code to periodically zero out 10,000 cells

  • Thread starter Thread starter lothario
  • Start date Start date
L

lothario

Hi,

I have 10,000 cells that need to be zero-ed out periodically.

Can you give me some VBA code that I can attach to a "Zero Out"
button?

So every time the "Zero Out" button is pressed the cells in the range
a1:a10000 are will be assigned the value of zero.

Thanks,
Luther
 
Hi:

Sub ZeroOut
Range("A1:A10000").Value = 0
End Sub

Regards,

Vasant.
 
Sub ZeroOut()
Range("A1:A10000").Value = 0
End Sub

or if you want to make them blank

Sub ClearOut()
Range("A1:A10000").Clearcontents
End Sub
 
Range("a1").resize(10000).value = 0
or
range("a1:a10000").value = 0
 

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

Back
Top