bs0d
Well-known Member
- Joined
- Dec 29, 2006
- Messages
- 622
Can someone help me with a function that would evaluate the contents of a sheet, find any #NAME errors, and replace contents with " ' " + contents to show the value (rather than the error)?
Here's start, but it's more of an algorithm than functional code. Thoughts here?
Here's start, but it's more of an algorithm than functional code. Thoughts here?
Code:
Dim sh As Worksheet
Dim fnd As Variant
Dim rpl As Variant
fnd = CVErr(ActiveWorkbook.Worksheets.sh.Cells)
rpl = "'" & ActiveWorkbook.Worksheets.sh.Cells.Value
For Each sh In ActiveWorkbook.Worksheets
sht.Cells.Replace what:=fnd, Replacement:=rpl, _
LookAt:=xlPart, SearchOrder:=xlByRows, MatchCase:=False, _
SearchFormat:=False, ReplaceFormat:=False
Next sh