#参考!粘贴为值,但在循环时看不到
#REF! pasted as value, but not seen as such when looping
我今天刚刚在我的部门发布了一个 Excel 加载项,过去 2 个多月我一直在努力检查大约 30 个验证错误。我在所有情况下都处理了错误捕获(就像现在出现的那样),但是今天我收到了一个可怕的叫醒电话,因为我收到了两个重要错误的自动电子邮件(我在错误处理中内置的一个功能)。我已经发布了一个关于第一个错误的问题 并且我想我会为第二个错误开始一个新的问题,因为它与第一个错误无关。
我的代码如下
Private Sub symbolCheck()
On Error GoTo ErrHandler
Application.StatusBar = "(3/16) Checking for invalid symbols"
Dim MyArray As Variant
Dim replacementsMade As Boolean
replacementsMade = False
MyArray = ActiveSheet.UsedRange
For i = LBound(MyArray) To UBound(MyArray)
For j = LBound(MyArray, 2) To UBound(MyArray, 2)
If MyArray(i, j) <> "" Then
'Apostrophe/Closing Single Quote
If InStr(1, MyArray(i, j), "’") > 0 Then
MyArray(i, j) = WorksheetFunction.Substitute(MyArray(i, j), "’", Chr(39))
If replacementsMade = False Then
replacementsMade = True
End If
End If
'Apostrophe
If InStr(1, MyArray(i, j), "`") > 0 Then
MyArray(i, j) = WorksheetFunction.Substitute(MyArray(i, j), "`", Chr(39))
If replacementsMade = False Then
replacementsMade = True
End If
End If
'Opening Single Quote
If InStr(1, MyArray(i, j), "‘") > 0 Then
MyArray(i, j) = WorksheetFunction.Substitute(MyArray(i, j), "‘", Chr(39))
If replacementsMade = False Then
replacementsMade = True
End If
End If
'Double Open Quotes
If InStr(1, MyArray(i, j), "“") > 0 Then
MyArray(i, j) = WorksheetFunction.Substitute(MyArray(i, j), "“", """")
If replacementsMade = False Then
replacementsMade = True
End If
End If
'Double Closing Quotes
If InStr(1, MyArray(i, j), "”") > 0 Then
MyArray(i, j) = WorksheetFunction.Substitute(MyArray(i, j), "”", """")
If replacementsMade = False Then
replacementsMade = True
End If
End If
'Dash
If InStr(1, MyArray(i, j), "–") > 0 Then
MyArray(i, j) = WorksheetFunction.Substitute(MyArray(i, j), "–", "-")
If replacementsMade = False Then
replacementsMade = True
End If
End If
'Registered Trademark (R)
If InStr(1, MyArray(i, j), "®") > 0 Then
MyArray(i, j) = WorksheetFunction.Substitute(MyArray(i, j), "®", "(R)")
If replacementsMade = False Then
replacementsMade = True
End If
End If
'Trademark (TM)
If InStr(1, MyArray(i, j), "™") > 0 Then
MyArray(i, j) = WorksheetFunction.Substitute(MyArray(i, j), "™", "(TM)")
If replacementsMade = False Then
replacementsMade = True
End If
End If
'Degree Symbol
If InStr(1, MyArray(i, j), "°") > 0 Then
MyArray(i, j) = WorksheetFunction.Substitute(MyArray(i, j), "°", " degrees")
If replacementsMade = False Then
replacementsMade = True
End If
End If
'Multiplication/x Symbol
If InStr(1, MyArray(i, j), "×") > 0 Then
MyArray(i, j) = WorksheetFunction.Substitute(MyArray(i, j), "×", "x")
If replacementsMade = False Then
replacementsMade = True
End If
End If
'Upside-Down Question Mark Symbol
If InStr(1, MyArray(i, j), "¿") > 0 Then
MyArray(i, j) = WorksheetFunction.Substitute(MyArray(i, j), "¿", "")
If replacementsMade = False Then
replacementsMade = True
End If
End If
'Solid Bullet Symbol
If InStr(1, MyArray(i, j), "•") > 0 Then
MyArray(i, j) = WorksheetFunction.Substitute(MyArray(i, j), "•", "")
If replacementsMade = False Then
replacementsMade = True
End If
End If
'Triple Dots Symbol
If InStr(1, MyArray(i, j), "…") > 0 Then
MyArray(i, j) = WorksheetFunction.Substitute(MyArray(i, j), "…", "...")
If replacementsMade = False Then
replacementsMade = True
End If
End If
'Euro Symbol
If InStr(1, MyArray(i, j), "€") > 0 Then
MyArray(i, j) = WorksheetFunction.Substitute(MyArray(i, j), "€", "")
If replacementsMade = False Then
replacementsMade = True
End If
End If
'Linebreak Symbol
If InStr(1, MyArray(i, j), "|") > 0 Then
MyArray(i, j) = WorksheetFunction.Substitute(MyArray(i, j), "|", ",")
If replacementsMade = False Then
replacementsMade = True
End If
End If
' 'Less Than Symbol
' If InStr(1, MyArray(i, j), "<") > 0 Then
' MyArray(i, j) = WorksheetFunction.Substitute(MyArray(i, j), "<", "<")
' End If
' 'Greater Than Symbol
' If InStr(1, MyArray(i, j), ">") > 0 Then
' MyArray(i, j) = WorksheetFunction.Substitute(MyArray(i, j), ">", ">")
' End If
'Half Fraction
If InStr(1, MyArray(i, j), "½") > 0 Then
MyArray(i, j) = WorksheetFunction.Substitute(MyArray(i, j), "½", " 1/2")
If replacementsMade = False Then
replacementsMade = True
End If
End If
'Three Quarter Fraction
If InStr(1, MyArray(i, j), "¾") > 0 Then
MyArray(i, j) = WorksheetFunction.Substitute(MyArray(i, j), "¾", " 3/4")
If replacementsMade = False Then
replacementsMade = True
End If
End If
'One Quarter Fraction
If InStr(1, MyArray(i, j), "¼") > 0 Then
MyArray(i, j) = WorksheetFunction.Substitute(MyArray(i, j), "¼", " 1/4")
If replacementsMade = False Then
replacementsMade = True
End If
End If
End If
Next j
Next i
If replacementsMade Then
ActiveSheet.UsedRange = MyArray
End If
Set MyArray = Nothing
Exit Sub
ErrHandler:
Err.Raise Err.Number, "symbolCheck", Err.Description
End Sub
线上出现此bug
If MyArray(i, j) <> "" Then
当 i = 209 和 j = 60 时,所以我四处寻找并查看数组内部以查看值是什么在那个位置。当我查看数组槽的监视列表值时,该值只是说 Error 2023
。因此,我查看了与 i 和 j 值对应的单元格,唉,我终于明白了为什么会出现错误。单元格中的值最初是一个带有引用错误的公式,因为我 copy/pasted 作为 运行 之前的值,我认为我会没事的。我不知道 #REF!
不被视为明文?
这引出了我的问题
我该如何处理这种情况?更准确地说,如果 #REF!
即使在被 Copy/Pasted 作为一个值?
清除#REF 的解决方案!电子表格中的值
您可以使用 SpecialCells 来清除错误。
ActiveSheet.UsedRange.SpecialCells(xlCellTypeFormulas, xlErrors).ClearContents 'Or change .Value to another value, delete cells, etc. as desired
处理#REF 的解决方案!数组中的错误
您可以使用 ISERROR() VBA 函数来捕获每个 #REF!然后根据需要进行处理。
修改您的代码如下:
Private Sub symbolCheck()
On Error GoTo ErrHandler
Application.StatusBar = "(3/16) Checking for invalid symbols"
Dim MyArray As Variant
Dim replacementsMade As Boolean
replacementsMade = False
MyArray = ActiveSheet.UsedRange
For i = LBound(MyArray) To UBound(MyArray)
For j = LBound(MyArray, 2) To UBound(MyArray, 2)
If IsError(MyArray(i, j)) Then
'Handle the #REF! here
ElseIf MyArray(i, j) <> "" Then
'Apostrophe/Closing Single Quote
If InStr(1, MyArray(i, j), "’") > 0 Then
MyArray(i, j) = WorksheetFunction.Substitute(MyArray(i, j), "’", Chr(39))
If replacementsMade = False Then
replacementsMade = True
End If
End If
'Apostrophe
If InStr(1, MyArray(i, j), "`") > 0 Then
MyArray(i, j) = WorksheetFunction.Substitute(MyArray(i, j), "`", Chr(39))
If replacementsMade = False Then
replacementsMade = True
End If
End If
'Opening Single Quote
If InStr(1, MyArray(i, j), "‘") > 0 Then
MyArray(i, j) = WorksheetFunction.Substitute(MyArray(i, j), "‘", Chr(39))
If replacementsMade = False Then
replacementsMade = True
End If
End If
'Double Open Quotes
If InStr(1, MyArray(i, j), "“") > 0 Then
MyArray(i, j) = WorksheetFunction.Substitute(MyArray(i, j), "“", """")
If replacementsMade = False Then
replacementsMade = True
End If
End If
'Double Closing Quotes
If InStr(1, MyArray(i, j), "”") > 0 Then
MyArray(i, j) = WorksheetFunction.Substitute(MyArray(i, j), "”", """")
If replacementsMade = False Then
replacementsMade = True
End If
End If
'Dash
If InStr(1, MyArray(i, j), "–") > 0 Then
MyArray(i, j) = WorksheetFunction.Substitute(MyArray(i, j), "–", "-")
If replacementsMade = False Then
replacementsMade = True
End If
End If
'Registered Trademark (R)
If InStr(1, MyArray(i, j), "®") > 0 Then
MyArray(i, j) = WorksheetFunction.Substitute(MyArray(i, j), "®", "(R)")
If replacementsMade = False Then
replacementsMade = True
End If
End If
'Trademark (TM)
If InStr(1, MyArray(i, j), "™") > 0 Then
MyArray(i, j) = WorksheetFunction.Substitute(MyArray(i, j), "™", "(TM)")
If replacementsMade = False Then
replacementsMade = True
End If
End If
'Degree Symbol
If InStr(1, MyArray(i, j), "°") > 0 Then
MyArray(i, j) = WorksheetFunction.Substitute(MyArray(i, j), "°", " degrees")
If replacementsMade = False Then
replacementsMade = True
End If
End If
'Multiplication/x Symbol
If InStr(1, MyArray(i, j), "×") > 0 Then
MyArray(i, j) = WorksheetFunction.Substitute(MyArray(i, j), "×", "x")
If replacementsMade = False Then
replacementsMade = True
End If
End If
'Upside-Down Question Mark Symbol
If InStr(1, MyArray(i, j), "¿") > 0 Then
MyArray(i, j) = WorksheetFunction.Substitute(MyArray(i, j), "¿", "")
If replacementsMade = False Then
replacementsMade = True
End If
End If
'Solid Bullet Symbol
If InStr(1, MyArray(i, j), "•") > 0 Then
MyArray(i, j) = WorksheetFunction.Substitute(MyArray(i, j), "•", "")
If replacementsMade = False Then
replacementsMade = True
End If
End If
'Triple Dots Symbol
If InStr(1, MyArray(i, j), "…") > 0 Then
MyArray(i, j) = WorksheetFunction.Substitute(MyArray(i, j), "…", "...")
If replacementsMade = False Then
replacementsMade = True
End If
End If
'Euro Symbol
If InStr(1, MyArray(i, j), "€") > 0 Then
MyArray(i, j) = WorksheetFunction.Substitute(MyArray(i, j), "€", "")
If replacementsMade = False Then
replacementsMade = True
End If
End If
'Linebreak Symbol
If InStr(1, MyArray(i, j), "|") > 0 Then
MyArray(i, j) = WorksheetFunction.Substitute(MyArray(i, j), "|", ",")
If replacementsMade = False Then
replacementsMade = True
End If
End If
' 'Less Than Symbol
' If InStr(1, MyArray(i, j), "<") > 0 Then
' MyArray(i, j) = WorksheetFunction.Substitute(MyArray(i, j), "<", "<")
' End If
' 'Greater Than Symbol
' If InStr(1, MyArray(i, j), ">") > 0 Then
' MyArray(i, j) = WorksheetFunction.Substitute(MyArray(i, j), ">", ">")
' End If
'Half Fraction
If InStr(1, MyArray(i, j), "½") > 0 Then
MyArray(i, j) = WorksheetFunction.Substitute(MyArray(i, j), "½", " 1/2")
If replacementsMade = False Then
replacementsMade = True
End If
End If
'Three Quarter Fraction
If InStr(1, MyArray(i, j), "¾") > 0 Then
MyArray(i, j) = WorksheetFunction.Substitute(MyArray(i, j), "¾", " 3/4")
If replacementsMade = False Then
replacementsMade = True
End If
End If
'One Quarter Fraction
If InStr(1, MyArray(i, j), "¼") > 0 Then
MyArray(i, j) = WorksheetFunction.Substitute(MyArray(i, j), "¼", " 1/4")
If replacementsMade = False Then
replacementsMade = True
End If
End If
End If
Next j
Next i
If replacementsMade Then
ActiveSheet.UsedRange = MyArray
End If
Set MyArray = Nothing
Exit Sub
ErrHandler:
Err.Raise Err.Number, "symbolCheck", Err.Description
End Sub
我今天刚刚在我的部门发布了一个 Excel 加载项,过去 2 个多月我一直在努力检查大约 30 个验证错误。我在所有情况下都处理了错误捕获(就像现在出现的那样),但是今天我收到了一个可怕的叫醒电话,因为我收到了两个重要错误的自动电子邮件(我在错误处理中内置的一个功能)。我已经发布了一个关于第一个错误的问题
我的代码如下
Private Sub symbolCheck()
On Error GoTo ErrHandler
Application.StatusBar = "(3/16) Checking for invalid symbols"
Dim MyArray As Variant
Dim replacementsMade As Boolean
replacementsMade = False
MyArray = ActiveSheet.UsedRange
For i = LBound(MyArray) To UBound(MyArray)
For j = LBound(MyArray, 2) To UBound(MyArray, 2)
If MyArray(i, j) <> "" Then
'Apostrophe/Closing Single Quote
If InStr(1, MyArray(i, j), "’") > 0 Then
MyArray(i, j) = WorksheetFunction.Substitute(MyArray(i, j), "’", Chr(39))
If replacementsMade = False Then
replacementsMade = True
End If
End If
'Apostrophe
If InStr(1, MyArray(i, j), "`") > 0 Then
MyArray(i, j) = WorksheetFunction.Substitute(MyArray(i, j), "`", Chr(39))
If replacementsMade = False Then
replacementsMade = True
End If
End If
'Opening Single Quote
If InStr(1, MyArray(i, j), "‘") > 0 Then
MyArray(i, j) = WorksheetFunction.Substitute(MyArray(i, j), "‘", Chr(39))
If replacementsMade = False Then
replacementsMade = True
End If
End If
'Double Open Quotes
If InStr(1, MyArray(i, j), "“") > 0 Then
MyArray(i, j) = WorksheetFunction.Substitute(MyArray(i, j), "“", """")
If replacementsMade = False Then
replacementsMade = True
End If
End If
'Double Closing Quotes
If InStr(1, MyArray(i, j), "”") > 0 Then
MyArray(i, j) = WorksheetFunction.Substitute(MyArray(i, j), "”", """")
If replacementsMade = False Then
replacementsMade = True
End If
End If
'Dash
If InStr(1, MyArray(i, j), "–") > 0 Then
MyArray(i, j) = WorksheetFunction.Substitute(MyArray(i, j), "–", "-")
If replacementsMade = False Then
replacementsMade = True
End If
End If
'Registered Trademark (R)
If InStr(1, MyArray(i, j), "®") > 0 Then
MyArray(i, j) = WorksheetFunction.Substitute(MyArray(i, j), "®", "(R)")
If replacementsMade = False Then
replacementsMade = True
End If
End If
'Trademark (TM)
If InStr(1, MyArray(i, j), "™") > 0 Then
MyArray(i, j) = WorksheetFunction.Substitute(MyArray(i, j), "™", "(TM)")
If replacementsMade = False Then
replacementsMade = True
End If
End If
'Degree Symbol
If InStr(1, MyArray(i, j), "°") > 0 Then
MyArray(i, j) = WorksheetFunction.Substitute(MyArray(i, j), "°", " degrees")
If replacementsMade = False Then
replacementsMade = True
End If
End If
'Multiplication/x Symbol
If InStr(1, MyArray(i, j), "×") > 0 Then
MyArray(i, j) = WorksheetFunction.Substitute(MyArray(i, j), "×", "x")
If replacementsMade = False Then
replacementsMade = True
End If
End If
'Upside-Down Question Mark Symbol
If InStr(1, MyArray(i, j), "¿") > 0 Then
MyArray(i, j) = WorksheetFunction.Substitute(MyArray(i, j), "¿", "")
If replacementsMade = False Then
replacementsMade = True
End If
End If
'Solid Bullet Symbol
If InStr(1, MyArray(i, j), "•") > 0 Then
MyArray(i, j) = WorksheetFunction.Substitute(MyArray(i, j), "•", "")
If replacementsMade = False Then
replacementsMade = True
End If
End If
'Triple Dots Symbol
If InStr(1, MyArray(i, j), "…") > 0 Then
MyArray(i, j) = WorksheetFunction.Substitute(MyArray(i, j), "…", "...")
If replacementsMade = False Then
replacementsMade = True
End If
End If
'Euro Symbol
If InStr(1, MyArray(i, j), "€") > 0 Then
MyArray(i, j) = WorksheetFunction.Substitute(MyArray(i, j), "€", "")
If replacementsMade = False Then
replacementsMade = True
End If
End If
'Linebreak Symbol
If InStr(1, MyArray(i, j), "|") > 0 Then
MyArray(i, j) = WorksheetFunction.Substitute(MyArray(i, j), "|", ",")
If replacementsMade = False Then
replacementsMade = True
End If
End If
' 'Less Than Symbol
' If InStr(1, MyArray(i, j), "<") > 0 Then
' MyArray(i, j) = WorksheetFunction.Substitute(MyArray(i, j), "<", "<")
' End If
' 'Greater Than Symbol
' If InStr(1, MyArray(i, j), ">") > 0 Then
' MyArray(i, j) = WorksheetFunction.Substitute(MyArray(i, j), ">", ">")
' End If
'Half Fraction
If InStr(1, MyArray(i, j), "½") > 0 Then
MyArray(i, j) = WorksheetFunction.Substitute(MyArray(i, j), "½", " 1/2")
If replacementsMade = False Then
replacementsMade = True
End If
End If
'Three Quarter Fraction
If InStr(1, MyArray(i, j), "¾") > 0 Then
MyArray(i, j) = WorksheetFunction.Substitute(MyArray(i, j), "¾", " 3/4")
If replacementsMade = False Then
replacementsMade = True
End If
End If
'One Quarter Fraction
If InStr(1, MyArray(i, j), "¼") > 0 Then
MyArray(i, j) = WorksheetFunction.Substitute(MyArray(i, j), "¼", " 1/4")
If replacementsMade = False Then
replacementsMade = True
End If
End If
End If
Next j
Next i
If replacementsMade Then
ActiveSheet.UsedRange = MyArray
End If
Set MyArray = Nothing
Exit Sub
ErrHandler:
Err.Raise Err.Number, "symbolCheck", Err.Description
End Sub
线上出现此bug
If MyArray(i, j) <> "" Then
当 i = 209 和 j = 60 时,所以我四处寻找并查看数组内部以查看值是什么在那个位置。当我查看数组槽的监视列表值时,该值只是说 Error 2023
。因此,我查看了与 i 和 j 值对应的单元格,唉,我终于明白了为什么会出现错误。单元格中的值最初是一个带有引用错误的公式,因为我 copy/pasted 作为 运行 之前的值,我认为我会没事的。我不知道 #REF!
不被视为明文?
这引出了我的问题
我该如何处理这种情况?更准确地说,如果 #REF!
即使在被 Copy/Pasted 作为一个值?
清除#REF 的解决方案!电子表格中的值
您可以使用 SpecialCells 来清除错误。
ActiveSheet.UsedRange.SpecialCells(xlCellTypeFormulas, xlErrors).ClearContents 'Or change .Value to another value, delete cells, etc. as desired
处理#REF 的解决方案!数组中的错误
您可以使用 ISERROR() VBA 函数来捕获每个 #REF!然后根据需要进行处理。
修改您的代码如下:
Private Sub symbolCheck()
On Error GoTo ErrHandler
Application.StatusBar = "(3/16) Checking for invalid symbols"
Dim MyArray As Variant
Dim replacementsMade As Boolean
replacementsMade = False
MyArray = ActiveSheet.UsedRange
For i = LBound(MyArray) To UBound(MyArray)
For j = LBound(MyArray, 2) To UBound(MyArray, 2)
If IsError(MyArray(i, j)) Then
'Handle the #REF! here
ElseIf MyArray(i, j) <> "" Then
'Apostrophe/Closing Single Quote
If InStr(1, MyArray(i, j), "’") > 0 Then
MyArray(i, j) = WorksheetFunction.Substitute(MyArray(i, j), "’", Chr(39))
If replacementsMade = False Then
replacementsMade = True
End If
End If
'Apostrophe
If InStr(1, MyArray(i, j), "`") > 0 Then
MyArray(i, j) = WorksheetFunction.Substitute(MyArray(i, j), "`", Chr(39))
If replacementsMade = False Then
replacementsMade = True
End If
End If
'Opening Single Quote
If InStr(1, MyArray(i, j), "‘") > 0 Then
MyArray(i, j) = WorksheetFunction.Substitute(MyArray(i, j), "‘", Chr(39))
If replacementsMade = False Then
replacementsMade = True
End If
End If
'Double Open Quotes
If InStr(1, MyArray(i, j), "“") > 0 Then
MyArray(i, j) = WorksheetFunction.Substitute(MyArray(i, j), "“", """")
If replacementsMade = False Then
replacementsMade = True
End If
End If
'Double Closing Quotes
If InStr(1, MyArray(i, j), "”") > 0 Then
MyArray(i, j) = WorksheetFunction.Substitute(MyArray(i, j), "”", """")
If replacementsMade = False Then
replacementsMade = True
End If
End If
'Dash
If InStr(1, MyArray(i, j), "–") > 0 Then
MyArray(i, j) = WorksheetFunction.Substitute(MyArray(i, j), "–", "-")
If replacementsMade = False Then
replacementsMade = True
End If
End If
'Registered Trademark (R)
If InStr(1, MyArray(i, j), "®") > 0 Then
MyArray(i, j) = WorksheetFunction.Substitute(MyArray(i, j), "®", "(R)")
If replacementsMade = False Then
replacementsMade = True
End If
End If
'Trademark (TM)
If InStr(1, MyArray(i, j), "™") > 0 Then
MyArray(i, j) = WorksheetFunction.Substitute(MyArray(i, j), "™", "(TM)")
If replacementsMade = False Then
replacementsMade = True
End If
End If
'Degree Symbol
If InStr(1, MyArray(i, j), "°") > 0 Then
MyArray(i, j) = WorksheetFunction.Substitute(MyArray(i, j), "°", " degrees")
If replacementsMade = False Then
replacementsMade = True
End If
End If
'Multiplication/x Symbol
If InStr(1, MyArray(i, j), "×") > 0 Then
MyArray(i, j) = WorksheetFunction.Substitute(MyArray(i, j), "×", "x")
If replacementsMade = False Then
replacementsMade = True
End If
End If
'Upside-Down Question Mark Symbol
If InStr(1, MyArray(i, j), "¿") > 0 Then
MyArray(i, j) = WorksheetFunction.Substitute(MyArray(i, j), "¿", "")
If replacementsMade = False Then
replacementsMade = True
End If
End If
'Solid Bullet Symbol
If InStr(1, MyArray(i, j), "•") > 0 Then
MyArray(i, j) = WorksheetFunction.Substitute(MyArray(i, j), "•", "")
If replacementsMade = False Then
replacementsMade = True
End If
End If
'Triple Dots Symbol
If InStr(1, MyArray(i, j), "…") > 0 Then
MyArray(i, j) = WorksheetFunction.Substitute(MyArray(i, j), "…", "...")
If replacementsMade = False Then
replacementsMade = True
End If
End If
'Euro Symbol
If InStr(1, MyArray(i, j), "€") > 0 Then
MyArray(i, j) = WorksheetFunction.Substitute(MyArray(i, j), "€", "")
If replacementsMade = False Then
replacementsMade = True
End If
End If
'Linebreak Symbol
If InStr(1, MyArray(i, j), "|") > 0 Then
MyArray(i, j) = WorksheetFunction.Substitute(MyArray(i, j), "|", ",")
If replacementsMade = False Then
replacementsMade = True
End If
End If
' 'Less Than Symbol
' If InStr(1, MyArray(i, j), "<") > 0 Then
' MyArray(i, j) = WorksheetFunction.Substitute(MyArray(i, j), "<", "<")
' End If
' 'Greater Than Symbol
' If InStr(1, MyArray(i, j), ">") > 0 Then
' MyArray(i, j) = WorksheetFunction.Substitute(MyArray(i, j), ">", ">")
' End If
'Half Fraction
If InStr(1, MyArray(i, j), "½") > 0 Then
MyArray(i, j) = WorksheetFunction.Substitute(MyArray(i, j), "½", " 1/2")
If replacementsMade = False Then
replacementsMade = True
End If
End If
'Three Quarter Fraction
If InStr(1, MyArray(i, j), "¾") > 0 Then
MyArray(i, j) = WorksheetFunction.Substitute(MyArray(i, j), "¾", " 3/4")
If replacementsMade = False Then
replacementsMade = True
End If
End If
'One Quarter Fraction
If InStr(1, MyArray(i, j), "¼") > 0 Then
MyArray(i, j) = WorksheetFunction.Substitute(MyArray(i, j), "¼", " 1/4")
If replacementsMade = False Then
replacementsMade = True
End If
End If
End If
Next j
Next i
If replacementsMade Then
ActiveSheet.UsedRange = MyArray
End If
Set MyArray = Nothing
Exit Sub
ErrHandler:
Err.Raise Err.Number, "symbolCheck", Err.Description
End Sub