View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Don Guillett Don Guillett is offline
external usenet poster
 
Posts: 10,124
Default Search and replace stuck on

Sounds like you put the code into a worksheet_change event that fires when
you change a cell that is not restricted. The line
c.Value = 5
is doing exactly what was asked of it. The code example was just that. An
example.

--
Don Guillett
SalesAid Software

"John Bundy" wrote in message
...
I have never run into anything like this,
I looked into excels help on programming find and replace functionality,
they offer the following code:
With Worksheets(1).Range("a1:a500")
Set c = .Find(2, lookin:=xlValues)
If Not c Is Nothing Then
firstAddress = c.Address
Do
c.Value = 5
Set c = .FindNext(c)
Loop While Not c Is Nothing And c.Address < firstAddress
End If
End With

I put a couple 2's in column a and ran and everything was fine. Went to
work
with thoughts of how to put this to use in my head and when I got home
needed
to type up a spreadsheet for work. Now whenever I typed a 2 it changed to
a
5, I threw away the old Excel spreadsheet earlier and deleted it. Any clue
on
how to stop this would be greatly appreciated.

-John