find all the special characters in the sheets

ramyadixit99

New Member
Joined
Jan 2, 2015
Messages
9
Hi,

I have 3 sheets of excel each having a size of 10 mb.
I need to find all the special characters in that sheet and then replace it with other values.
I did it manually and it took me almost 6 hrs to do.
I have started using macros, and now i need to a macro to find all the special characters there is in the sheet.

Regards,
Ramya
 
Reviving this thread :)

Is there a way to replace the special characters with non-special ones instead of highlighting them?
 
Upvote 0

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
Try this code.

It paints in yellow all the cells that have a text constant that has a character not in the list that you posted.

Code:
Sub ReplChars()
Dim sCharOK As String, s As String
Dim r As Range, rc As Range
Dim j As Long

sCharOK = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,-.:;{}[]_"

Set r = Worksheets("Sheet1").UsedRange.SpecialCells(xlCellTypeConstants, xlTextValues)

' loop through all the cells with text constant values and paints in yellow the ones with characters not in sCharOK
For Each rc In r
    s = rc.Value
    For j = 1 To Len(s)
        If InStr(sCharOK, Mid(s, j, 1)) = 0 Then
            rc.Interior.Color = vbYellow
            Exit For
        End If
    Next j
Next rc

End Sub
Actually highlighting works fine for my process, however I have another question. How can I restrict this to run in 3 specific columns only?
 
Upvote 0

Forum statistics

Threads
1,223,113
Messages
6,170,171
Members
452,306
Latest member
Shaz11

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top