wigi
Well-known Member
- Joined
- Jul 10, 2006
- Messages
- 7,964
- Office Version
- 365
- Platform
- Windows
- Mobile
- Web
Hi all
This code searches for an asterisk in a range. In effect, it replaces cells with 0-5* to 0-5. All goes well, except if there's only 1 time a 0-5* and that instance is in the first cell of the range.
Does anyone know how to correct it?
Thanks in advance
Wigi
This code searches for an asterisk in a range. In effect, it replaces cells with 0-5* to 0-5. All goes well, except if there's only 1 time a 0-5* and that instance is in the first cell of the range.
Code:
Set foundcell = rngStanden.Find("~*", LookIn:=xlValues, lookat:=xlPart)
If Not foundcell Is Nothing Then
firstAddress = foundcell.Address
Do
foundcell.Value = "0-5"
Set foundcell = rngStanden.FindNext(foundcell)
Loop While Not foundcell Is Nothing And foundcell.Address <> firstAddress 'here's the error
End If
Does anyone know how to correct it?
Thanks in advance
Wigi