I renamed the worksheet to a unique string. Then looked for that unique string
in the formulas.
This way if you have:
="the value from SourceData! is too large for date: " _
& text(today(),"mm/dd/yyyy")
(not much chance, but why take it?)
Option Explicit
Sub testme()
Dim SourceDataWks As Worksheet
Dim OldName As String
Dim NewName As String
Dim wks As Worksheet
Dim myCell As Range
Dim myRng As Range
Dim myStr As String
NewName = String(31, "9")
Set SourceDataWks = Worksheets("sourcedata")
OldName = SourceDataWks.Name
SourceDataWks.Name = NewName
myStr = "'" & NewName & "'"
For Each wks In ActiveWorkbook.Worksheets
If wks.Name = SourceDataWks.Name Then
'do nothing
Else
With wks
Set myRng = Nothing
On Error Resume Next
Set myRng = .Cells.SpecialCells(xlCellTypeFormulas)
On Error GoTo 0
If myRng Is Nothing Then
'do nothing, no formulas
Else
For Each myCell In myRng.Cells
If InStr(1, myCell.Formula, myStr, _
vbTextCompare) > 0 Then
myCell.Value = myCell.Value
End If
Next myCell
End If
End With
End If
Next wks
SourceDataWks.Name = OldName
End Sub
If you have a worksheet named "99999999999999999..." 31 times, then use a
different name.