+ Reply to Thread
Results 1 to 11 of 11

How to look for Roman characters and match characters with diacritics

  1. #1
    Registered User
    Join Date
    03-11-2019
    Location
    Sweden
    MS-Off Ver
    Office 365
    Posts
    12

    How to look for Roman characters and match characters with diacritics

    Hey,
    So I stumbled into a thread (can't link the thread since this is my first post) from two years ago that addressed this specific "issue" but when I tried to implement the solution myself I unfortunately fell short. I have downloaded the .xlsm provided by a forum moderator.

    Please Login or Register  to view this content.
    However when I try to run the macro nothing happens after I press "Find Next" regardless of what input I insert.
    I have also already ticked "Microsoft Scripting Runtime" in "References".

    Any help is appreciated!
    Attached Images Attached Images
    Last edited by Lymoz; 03-12-2019 at 08:21 PM.

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: How to look for Roman characters and match characters with diacritics

    The referenced thread is How to ignore accented characters in a string.

    The original file is attached for easier reference.

    The attached file was to demonstrate just one example, MOHŠÌÑ. If you type MOHSIN in the search box it will find occurrences of MOHŠÌÑ in the worksheet.

    What data are you putting in the worksheet and what are you typing in the box?
    Jeff
    | | |·| |·| |·| |·| | |:| | |·| |·|
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Registered User
    Join Date
    03-11-2019
    Location
    Sweden
    MS-Off Ver
    Office 365
    Posts
    12

    Re: How to look for Roman characters and match characters with diacritics

    Nothing happens even if I type "MOHSIN" in the search, and I'm not really sure what to do since I do not know enough about VBA to troubleshoot myself.

  4. #4
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: How to look for Roman characters and match characters with diacritics

    Here is an update to the file. The only change is to provide a button to make it easier to invoke the search.

    Here is a video of me using it.

    https://youtu.be/O5T0FbSgvlk

    How is what you are doing different than this?

  5. #5
    Registered User
    Join Date
    03-11-2019
    Location
    Sweden
    MS-Off Ver
    Office 365
    Posts
    12

    Re: How to look for Roman characters and match characters with diacritics

    Yes, now it works! And I am ashamed to admit this but I think I know what I did wrong. I didn't know that the new search function was case-sensitive, which I should've known since capital letters have unique ASCII codes (if i understand this correctly, which I most probably don't). Which means there was nothing wrong with the initial file of course. I was also just wondering if it is possible to somehow alter the code for the macro to not make it case-sensitive like the regular search function? In other words I wouldn't need to type "MOHSIN" in caps and "mohsin" would also lead to a hit.

    This request is just a minor detail and is not really that important anyway but just wondering. If this is too much to ask or makes the programming a lot more troublesome I completely understand!

    And either way thanks for helping out a not-so-tech-savvy guy like me!

  6. #6
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,907

    Re: How to look for Roman characters and match characters with diacritics

    This seems to work just fine.
    Please Login or Register  to view this content.
    Avoid using Select, Selection and Activate in your code. Use With ... End With instead.
    You can show your appreciation for those that have helped you by clicking the * at the bottom left of any of their posts.

  7. #7
    Registered User
    Join Date
    03-11-2019
    Location
    Sweden
    MS-Off Ver
    Office 365
    Posts
    12

    Re: How to look for Roman characters and match characters with diacritics

    Thanks bakerman2!
    This fixed the issue with the search being case-sensitive!

    I think this is the last issue I'm gonna have with the code and I thank everyone that has helped me! The issue now is that when I try to apply this to another excel file (I have imported all the necessary modules and forms), I receive the following error message: "Run-time error '1004': Select method of Range class failed". Thereafter when I press debug it directs me to the following line in the code: "C.Select" (the last of the "C.Select" with there being several of them in the code, the one just before "Exit Sub").
    Please Login or Register  to view this content.
    How do I change the range of the macro to include the entire workbook, if possible?

    Thanks a bunch in advance! You guys are all very kind to help me!
    Attached Images Attached Images
    Last edited by Lymoz; 03-17-2019 at 02:44 PM.

  8. #8
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,907

    Re: How to look for Roman characters and match characters with diacritics

    Can you post the workbook where the error occurs because with Jeff's example file I can't reproduce the error.

  9. #9
    Registered User
    Join Date
    03-11-2019
    Location
    Sweden
    MS-Off Ver
    Office 365
    Posts
    12

    Re: How to look for Roman characters and match characters with diacritics

    Sure! I want the search function mainly for the second sheet in the workbook since it has a lot of diacritics that I can't type with my current keyboard layout (but if possible for the whole workbook).
    Attached Files Attached Files

  10. #10
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: How to look for Roman characters and match characters with diacritics

    Change
    Please Login or Register  to view this content.
    to
    Please Login or Register  to view this content.
    Entia non sunt multiplicanda sine necessitate

  11. #11
    Registered User
    Join Date
    03-11-2019
    Location
    Sweden
    MS-Off Ver
    Office 365
    Posts
    12

    Re: How to look for Roman characters and match characters with diacritics

    Quote Originally Posted by shg View Post
    Change
    Please Login or Register  to view this content.
    to
    Please Login or Register  to view this content.
    Thanks! That solved the run-time error! If it's not too much to ask, I would also like the search function to search within all of the sheets in the workbook if possible. Even though I continue to make requests after requests regarding the code, I would just like you all to know that I truly appreciate all of the help!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. VBA Characters() Function Fails when the Cell Content Exceeds 261 Characters
    By :) Sixthsense :) in forum Excel Programming / VBA / Macros
    Replies: 19
    Last Post: 03-07-2016, 06:37 AM
  2. Replies: 2
    Last Post: 02-09-2016, 11:00 AM
  3. [SOLVED] VBA, remove all characters within a string, except numerical characters and full stops
    By rain4u in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-25-2015, 09:24 PM
  4. [SOLVED] Delete characters and add * in front and last characters in ACCESS QUERY
    By LALTIZER in forum Access Tables & Databases
    Replies: 9
    Last Post: 02-01-2013, 02:06 PM
  5. Replies: 11
    Last Post: 01-23-2013, 02:04 PM
  6. Replies: 2
    Last Post: 11-01-2011, 05:14 PM
  7. [SOLVED] In Excel find characters when multiple characters exist w/i a cel
    By teacher-deburg in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 12-05-2005, 06:25 PM

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