Results 1 to 9 of 9

Remove chinese chars

Threaded View

Smrie Remove chinese chars 04-26-2020, 07:46 AM
PCI Re: Remove chinese chars 04-26-2020, 09:51 AM
PCI Re: Remove chinese chars 04-26-2020, 10:17 AM
Smrie Re: Remove chinese chars 04-27-2020, 08:20 AM
davsth Re: Remove chinese chars 04-27-2020, 08:46 AM
PCI Re: Remove chinese chars 04-27-2020, 10:43 AM
Smrie Re: Remove chinese chars 04-27-2020, 12:21 PM
Smrie Re: Remove chinese chars 04-27-2020, 12:41 PM
Smrie Re: Remove chinese chars 04-27-2020, 01:53 PM
  1. #1
    Registered User
    Join Date
    04-25-2020
    Location
    Netherlands
    MS-Off Ver
    2013
    Posts
    6

    Remove chinese chars

    Hi,

    I have excel files which containing chinese characters. When i run code on these files i get an error while saving. Showing me that file "Some filename ?????" can not be found. It seems it converts chinese characters to question marks.
    I tried a regex as seen below to remove the chinese pattern or question marks with string - 9 characters because that would remove them always. ( i also tried [\u4E00-\u9FFF]) But i can not use the name as function because the name in the variable Fname with ???? is different from the actual file in my folder which has chinese characters, which i can not get in a variable. How do i get around this?. See my code below.

    Sub LoopThroughFiles()
    Dim FName As Variant
    Dim strNew As String
    Dim strDir As String
    
    strDir = "C:\Users\samjanss\Documents\Proberen\chinese trein\"
    FName = Dir(strDir & "*.*")
    Do While Len(FName) > 0
    strNew = Left(FName, Len(FName) - 9)
    Debug.Print strNew
    Debug.Print FName
        If StrComp(strNew, FName) <> 0 Then Name (strDir & FName) As (strDir & strNew)
    FName = Dir
    Loop
    End Sub
    Last edited by Smrie; 04-27-2020 at 12:20 PM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Remove Text After Certain Amount Of Chars
    By StephenSmith in forum Excel General
    Replies: 8
    Last Post: 08-06-2019, 02:31 AM
  2. [SOLVED] Remove Chinese text from cells.
    By taffthefish in forum Office 365
    Replies: 4
    Last Post: 06-20-2018, 09:08 PM
  3. [SOLVED] Save old data on query refresh to 1st empty cell in next col (done). Remove last 4 chars.
    By MartinS13X in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-19-2015, 06:21 AM
  4. Remove certain chars
    By viks83 in forum Outlook Programming / VBA / Macros
    Replies: 1
    Last Post: 10-23-2015, 11:19 AM
  5. Remove Chars in Call Based on Condition
    By FallingDown in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-13-2014, 06:20 AM
  6. Remove iNdex chars From Left
    By teodormircea in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-21-2009, 08:19 AM
  7. remove blanks from a string of chars within a cell?
    By rayhollidge in forum Excel General
    Replies: 3
    Last Post: 01-07-2005, 11:08 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1