Hi Arnold
Use it like this
Set MyRange = ActiveCell.CurrentRegion
MyRange.SpecialCells(xlCellTypeBlanks).Value = "0" '
--
Regards Ron de Bruin
http://www.rondebruin.nl
"Arnold Klapheck" wrote in message
...
I am trying to tighten up some old code that used a loop to change blank
cells to 0.
I want to use the following code but it doesn't work.
Range("A2").Select
Set MyRange = ActiveCell.CurrentRegion
MyRange.Select
Range(MyRange).SpecialCells(xlCellTypeBlanks) = "0" ' this does not work
' old code had a loop structure here using MyRange and it works but is slow
if I use [Range(a1:aq237).SpecialCells(xlCellTypeBlanks) = "0"] then it
works fine, any ideas.
thanx