+ Reply to Thread
Results 1 to 10 of 10

Emoji Unicode VBA replace code with icon in cells

  1. #1
    Registered User
    Join Date
    07-14-2018
    Location
    London, England
    MS-Off Ver
    OSX v16.12
    Posts
    16

    Emoji Unicode VBA replace code with icon in cells

    Hi,

    I have a question about Emoji and making sense of a lot of unicode riddled in my sheet.

    I have a list of all the possible unicodes from Github - It won't let me post the link now but if you search google for "gemoji/support.md" it is the top of the list.

    There are 1432 examples in the list and I think around 150 have been used so it is too many for the SUBSTITUTE function. I've copied the list into excel and they work as icon emoji in the sheet.

    And so its possible to use VBA to cycle through around 5,000 lines in one column, search for the unicode reference and then replace with the actual emojis?

    Thanks for your help, I know this may be very challenging but if anyone has time to help that would be much appreciated.

    A!
    Last edited by asitiz; 07-14-2018 at 08:33 AM.

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: Emoji Unicode VBA replace code with icon in cells

    Hi, welcome to the forum

    Sorry, so what exactly is it yo are trying to do here?
    (there really is only 1184 emoji, the bottom section is just letters - not that it really matters)
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Registered User
    Join Date
    07-14-2018
    Location
    London, England
    MS-Off Ver
    OSX v16.12
    Posts
    16

    Re: Emoji Unicode VBA replace code with icon in cells

    Hi Ford,

    Thank you for coming back on this, I appreciate your help. So here is an example of one line, lets say A1 that is held in the sheet named text.

    Please Login or Register  to view this content.
    And so breaking it down

    \u2764\uFE0F is heart ❤️
    \uD83C\uDFCA is swimming_man; swimmer ��
    \uD83D\uDE0E is sunglasses ��

    So I need to try to have Excel transform the line into this instead

    Please Login or Register  to view this content.
    Programatically one thing I've noticed is that when searching for heart ❤️ (\u2764\uFE0F) it's unicode also forms part of the longer couple_with_heart_woman_woman (\ud83d\udc69\u200d\u2764\ufe0f\u200d\ud83d\udc69) and so I guess if using a list search that may be something to take into consideration.

    I have about 5,000 messages, around 50% of them have between 1 and 4 emojis in there and many don't make sense without them. They are all separated out with a space at either side and so the full string match should be possible but I aren't sure how to go about creating a list useable as a lookup in VBA or how to cycle through the cells and check for matches.

    Hope this makes sense, please let me know if I can clarify or send more examples. If we can get it working I'll post a working version for other people to use and we can adjust the wording and hashtags based on your advice so it can help people in future. I guess quite a lot of people want to do this, and growing but there hasn't been any examples of it I can find anywhere.

    Regards, A!
    Last edited by asitiz; 07-14-2018 at 10:54 AM.

  4. #4
    Forum Guru karedog's Avatar
    Join Date
    10-03-2014
    Location
    Indonesia
    MS-Off Ver
    2003
    Posts
    2,971

    Re: Emoji Unicode VBA replace code with icon in cells

    Maybe :
    Please Login or Register  to view this content.
    Attached Files Attached Files
    1. I care dog
    2. I am a loop maniac
    3. Forum rules link : Click here
    3.33. Don't forget to mark the thread as solved, this is important

  5. #5
    Registered User
    Join Date
    07-14-2018
    Location
    London, England
    MS-Off Ver
    OSX v16.12
    Posts
    16

    Re: Emoji Unicode VBA replace code with icon in cells

    Sorry I double posted the same message somehow here
    Last edited by asitiz; 07-14-2018 at 01:04 PM.

  6. #6
    Registered User
    Join Date
    07-14-2018
    Location
    London, England
    MS-Off Ver
    OSX v16.12
    Posts
    16

    Re: Emoji Unicode VBA replace code with icon in cells

    Hi Karedog,

    Great, thank you so much for your help, I tried the attached sample and I get the error

    ActiveX component can’t create object

    I've tried adding:

    Please Login or Register  to view this content.
    ....but I still get the message - Can anyone help with where to look? I'm using OSX Office Excel v.16.12

    Regards, A!

  7. #7
    Forum Guru karedog's Avatar
    Join Date
    10-03-2014
    Location
    Indonesia
    MS-Off Ver
    2003
    Posts
    2,971

    Re: Emoji Unicode VBA replace code with icon in cells

    Yes, VBScript.RegExp is only available on Windows OS, so please try this code instead :

    Please Login or Register  to view this content.
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    07-14-2018
    Location
    London, England
    MS-Off Ver
    OSX v16.12
    Posts
    16

    Re: Emoji Unicode VBA replace code with icon in cells

    Hi Karedog

    Amazing. It works! Really useful script I think for people who who want to analyse social media data in bulk.

    Kind regards, A!

  9. #9
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,647

    Re: Emoji Unicode VBA replace code with icon in cells

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  10. #10
    Forum Guru karedog's Avatar
    Join Date
    10-03-2014
    Location
    Indonesia
    MS-Off Ver
    2003
    Posts
    2,971

    Re: Emoji Unicode VBA replace code with icon in cells

    You are welcome, glad to help.

    Regards

+ 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. Macro for search and replace dash - unicode character not recognised
    By martin.wirenstrand in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-15-2016, 05:06 AM
  2. Removing emoji from string
    By didierkassas in forum Excel General
    Replies: 7
    Last Post: 02-15-2016, 01:45 AM
  3. How do I translate all characters of selected cells to Unicode?
    By nshadow1996 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 04-19-2014, 04:15 PM
  4. Best way to find/replace Unicode characters
    By greek in forum Word Programming / VBA / Macros
    Replies: 4
    Last Post: 03-17-2014, 05:39 PM
  5. [SOLVED] Find and replace special characters (unicode)
    By joevan1 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-10-2013, 06:05 AM
  6. Formula to handle cells with unicode needed
    By hyyfte in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-12-2007, 08:37 AM
  7. Unicode and Search and Replace
    By Rebecca in forum Excel - New Users/Basics
    Replies: 3
    Last Post: 10-30-2005, 02:05 AM

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