View Single Post
  #8   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

I surrounded the #REF! with wildcards: *#REF!*

and in my tests, the cells that contained any #REF! errors were changed to 0's.

Or did you mean something else?

Tom Ogilvy wrote:

?????

--
Regards,
Tom Ogilvy

"Dave Peterson" wrote:

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


--

Dave Peterson