ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Need VBA code to periodically zero out 10,000 cells (https://www.excelbanter.com/excel-programming/279457-need-vba-code-periodically-zero-out-10-000-cells.html)

lothario[_3_]

Need VBA code to periodically zero out 10,000 cells
 
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



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/


Vasant Nanavati

Need VBA code to periodically zero out 10,000 cells
 
Hi:

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

Regards,

Vasant.


"lothario" wrote in message
...
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



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/




Tom Ogilvy

Need VBA code to periodically zero out 10,000 cells
 
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


--
Regards,
Tom Ogilvy


lothario wrote in message
...
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



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/




Dave Peterson[_3_]

Need VBA code to periodically zero out 10,000 cells
 
Range("a1").resize(10000).value = 0
or
range("a1:a10000").value = 0




lothario wrote:

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

------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/


--

Dave Peterson


lothario[_4_]

Need VBA code to periodically zero out 10,000 cells
 
Thank you very much.



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/



All times are GMT +1. The time now is 09:39 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com