Removing Japanese characters from workbook

tvsramesha

New Member
Joined
Aug 12, 2016
Messages
13
Hi All -
Thanks in advance, I'm using OCR conversion and importing into excel, the label from contains Japanese characters apart from alphanumeric(western) characters, want to only clean the Japanese characters, please help me with a macro to remove the Japanese characters(copied below)

Ramesha

品番 1889816-1サイズ胸囲90丫 4品質表示表地 毛 5 2%ポリエステル4 8%
品番 1889813-1 1サイズ胸囲胴囲94 82A6 |品質表不表地 毛 ん八丨丨丁フニ

<colgroup><col><col><col span="2"><col><col span="2"><col><col><col><col><col><col></colgroup><tbody>
</tbody>
 

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.
Hi,

The following macro will take the region around A1 (that means that you can not have empty rows and columns) and delete content from cells that are 100% Japanese
Code:
Sub Jap100()
Dim Rng As Range
With CreateObject("vbscript.regexp")
    .Global = True
    .Pattern = "[^\d^\w^\s-\.\,]"
    For Each Rng In Range("A1").CurrentRegion
        Rng = .Replace(Rng, "")
    Next Rng
End With
End Sub

If you prefer to select the area and being able to delete all Japanese caracters (cleaner) , even if some cells are mixed, then use following

Code:
Sub CleanText(ByVal Rng As Range)
    Dim Cell As Range
        
        With CreateObject("vbscript.regexp")
            .Global = True
            .Pattern = "[^\u0020-\u007F]"
            For Each Cell In Rng
                Cell = .Replace(Cell, "")
            Next Cell
        End With
        
End Sub
Sub ToClean()
Call Module1.CleanText(Selection)
End Sub


Source:excelforum
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,827
Messages
6,121,816
Members
449,049
Latest member
cybersurfer5000

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