View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.misc
al al is offline
external usenet poster
 
Posts: 363
Default Enter value zero into all cells in multiple ranges?

Wow, that was quick! I'm not too familiar with macros, but I'm sure we can
work it out!
How do I drop a command button to the spreadsheet?

"FSt1" wrote:

Fhi
probably the simplest way would be this
Sub zapitzero()
Range("A2,A2,G2,A4,E4,f4,A6:A8").Value = 0
End Sub

Add/remove cell references to suit.
you could attach the macro to a custom icon or drop a command button on the
sheet.
Regards
FSt1

"Al" wrote:

I wish to automatically enter a zero across multiple non-adjacent cells so as
to "refresh" a template at the beginning of a calculation. I have 255 such
ranges, although these cell are not yet set up as ranges. (eg j17:t52,
w17:z52, j59:t78, w59:z78......)
I currently keep an empty row - no data, only zeros - and each time I
refresh the spreadsheet I simply copy and paste the empty row across the rows
containing data. I works, but I think there could be an easier way?

Is there such a thing as "set range1, range 2.....range 255 = 0"?