View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Arnold Klapheck Arnold Klapheck is offline
external usenet poster
 
Posts: 42
Default Use of Range Property

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