I have my code pasted below and would like some help undertsanding why an error now occurs. I use this macro to clear glyphs that creep in when importing and exporting product information. I had the macro working for a while adding to the list of items to check for (partial list posted). I wanted to check for a new character â and copied the Selection.Find portion and added a new On Error GoTo when my error started. I can't figure out why I'm getting the error. I reassigned strREPLACEMENT the line above it and copied the Selection.Find when it was working fine. Anything I need to clarify?
</space>
Code:
Sub Glyph_Check_and_Removal_or_Proper_Substitution()
Dim strREPLACEMENT As String
strREPLACEMENT = "^^^"
On Error GoTo Err1:
'Section for Character misinterpretation
'Sub ’ (should be "’") for '
'Doesn't come up with error apparently uploading to volusion
Selection.Replace What:="’", _
Replacement:="'", _
LookAt:=xlPart, SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
'----------------------------------------
'Right Quotes
Selection.Replace What:="â�", Replacement:="""", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Selection.Replace What:="�", Replacement:="""", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
'---------------------------------
Selection.Replace What:="â¾", Replacement:="¾", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Selection.Replace What:="¾", Replacement:="¾", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
'------------
'Non-breaking space replace chr(160) Displays as a <space> but it ISNT!
Selection.Replace What:=" ", Replacement:=" ", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
'---------------------------------
Selection.Replace What:="�", Replacement:=strREPLACEMENT, LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
'---------------------------------
'Find a way to check for both of these
Selection.Find(What:=strREPLACEMENT, LookIn:=xlFormulas, LookAt:= _
xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False _
, SearchFormat:=False).Select
MsgBox "Careful there buddy! Gotta Find " & strREPLACEMENT & vbCrLf & "After " & strREPLACEMENT & " is corrected reselect and run macro", vbOKOnly, "Your Attention Please!"
Exit Sub
Err1:
On Error GoTo Err2:
strREPLACEMENT = "â"
[B] Selection.Find(What:=strREPLACEMENT, LookIn:=xlFormulas, LookAt:= _
xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False _
, SearchFormat:=False).Select
[/B]
MsgBox "Careful there buddy! Gotta Find " & strREPLACEMENT & vbCrLf & "After " & strREPLACEMENT & " is corrected reselect and run macro", vbOKOnly, "Your Attention Please!"
Exit Sub
Err2:
MsgBox """Looks"" like everything is clear." & vbCrLf & "Just be careful.", vbOKOnly, "Your Attention Please!"
'---------------------------------
Exit Sub
End Sub