View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default Find #Ref! and replace

Another option based on Brian's suggestion:

Cells.Replace What:="*#REF!*", _
Replacement:="0", _
LookAt:=xlPart, _
SearchOrder:=xlByRows, _
MatchCase:=False


Brian wrote:

How can i in code find alll cells that have #Ref! and replace it with 0?


Do this:

Cells.Replace What:="#REF!", Replacement:="0", LookAt:=xlPart,
SearchOrder:=xlByRows, MatchCase:=False

Brian Herbert Withun


--

Dave Peterson