+ Reply to Thread
Results 1 to 15 of 15

How to Automatically convert simple words or phrases to symbols

  1. #1
    Registered User
    Join Date
    02-06-2017
    Location
    California, US
    MS-Off Ver
    Office 2016
    Posts
    38

    How to Automatically convert simple words or phrases to symbols

    Hello,

    I currently have to use custom symbols to generate a report. Generating this report currently takes hours because I have to scroll through the symbols and insert the symbol as needed. I am attempting to create a macro that will automate this process, however, I need help.

    Is there a function in Excel which will take plain text and convert it to a symbol? I have been experimenting with "VLookup" but it is not enough to accomplish what I need. What I need is to type text into a cell and have that text automatically converted into a corresponding symbol.

    Any help on this would be greatly appreciated. View the attached file for an example.
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    02-14-2009
    Location
    .
    MS-Off Ver
    ................
    Posts
    2,840

    Re: How to Automatically convert simple words or phrases to symbols

    The basic problem is you cannot type text in a cell and have a formula (in the same cell) replace that text with something else... and formulas can only update the cell they are so you cannot have a formula in another cell either... it can be done with VBA, though...

  3. #3
    Registered User
    Join Date
    02-06-2017
    Location
    California, US
    MS-Off Ver
    Office 2016
    Posts
    38

    Re: How to Automatically convert simple words or phrases to symbols

    Yes, I believe it can be done in VBA as well... unfortunately that is beyond my understanding

  4. #4
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2404
    Posts
    13,406

    Re: How to Automatically convert simple words or phrases to symbols

    I hesitate to suggest it, but have you tried Auto correct? File > Options > Proofing > Auto correct options.

    I say that I hesitate because these carry over into Word also ... and other places inconvenient. While you can override them it is a pain.
    Dave

  5. #5
    Registered User
    Join Date
    02-06-2017
    Location
    California, US
    MS-Off Ver
    Office 2016
    Posts
    38

    Re: How to Automatically convert simple words or phrases to symbols

    Auto-correct will only work with default symbols, the symbols I will be using are from a font that was created for this task.
    I tried assigning CTRL+ALT shortcut keys but this can only be done in Microsoft word and the changes are not carried over to excel.

  6. #6
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2404
    Posts
    13,406

    Re: How to Automatically convert simple words or phrases to symbols

    So copy / paste the literal font-specific symbols into Auto-correct doesn't work in Excel?

    Edit No it doesn't.
    Last edited by FlameRetired; 04-19-2017 at 02:35 PM. Reason: answered my own question.

  7. #7
    Forum Expert
    Join Date
    02-14-2009
    Location
    .
    MS-Off Ver
    ................
    Posts
    2,840

    Re: How to Automatically convert simple words or phrases to symbols

    Sorry, should have kept an eye on this - the issue with the font is the only reason I didn't mentions Auto Correct.

    Another complication is that only part of the cell is to be formatted, so VBA is the only solution.

    Please Login or Register  to view this content.
    Open the VBA editor (Alt-F11), double click on the worksheet this is to be used on in the Project Explorer (Ctrl-R if not visible) and paste. I'm assuming there's no existing code so replace anything in the code window with the above. Note the file will have to be saved as an XLSM file (Use Save As and change the file type in the drop down below the directory listing). and you will be prompted to enable macros when you load the file unless it is placed in a Trusted Location.

    For simplicity, this just replaces 1 occurrence of a term per cell...

  8. #8
    Registered User
    Join Date
    02-06-2017
    Location
    California, US
    MS-Off Ver
    Office 2016
    Posts
    38

    Re: How to Automatically convert simple words or phrases to symbols

    Thanks!

    Just for clarification I should remove the line in red and simply replace "Windings" with my custom font name.

    Please Login or Register  to view this content.

  9. #9
    Forum Expert
    Join Date
    02-14-2009
    Location
    .
    MS-Off Ver
    ................
    Posts
    2,840

    Re: How to Automatically convert simple words or phrases to symbols

    I don't have the font you're using so testing using Wingdings. Remove line above, uncomment line below
    Uncomment means remove the apostrophe (') at the start of the line as that makes the compiler treat the line as a comment and it is ignored. There's no need to add the font name, it takes it from the cell the symbol comes from. If you should decide to change the font then no need to change the code.

    Also note...
    For simplicity, this just replaces 1 occurrence of a term per cell
    Last edited by cytop; 04-20-2017 at 10:48 AM.

  10. #10
    Registered User
    Join Date
    02-06-2017
    Location
    California, US
    MS-Off Ver
    Office 2016
    Posts
    38

    Re: How to Automatically convert simple words or phrases to symbols

    I have made the changes and when I type "Datum A" in cell D2 the text does not change.

    *Addition*
    I also noticed that if I type anything into any of the cells in column A it will automatically change the text to the corresponding symbol in column B. My goal is to be able to type the text that is in column A anywhere in the workbook and have that automatically change to the corresponding symbol in column B.

    This is exactly what I have in VBA sheet2

    Please Login or Register  to view this content.
    I appreciate your help and patience!
    Last edited by anthony777; 04-20-2017 at 11:05 AM.

  11. #11
    Forum Expert
    Join Date
    02-14-2009
    Location
    .
    MS-Off Ver
    ................
    Posts
    2,840

    Re: How to Automatically convert simple words or phrases to symbols

    Reading code is not rocket science, writing it even less so as it tells you when you make a mistake (code only of course, not logic, and then just most times) - so give it a whirl. Try reading/understanding what each line does and see if you can pick out the bit that needs to be removed...

  12. #12
    Forum Expert
    Join Date
    02-14-2009
    Location
    .
    MS-Off Ver
    ................
    Posts
    2,840

    Re: How to Automatically convert simple words or phrases to symbols

    But, if you need a hand...

    Change
    Please Login or Register  to view this content.
    to
    Please Login or Register  to view this content.

  13. #13
    Registered User
    Join Date
    02-06-2017
    Location
    California, US
    MS-Off Ver
    Office 2016
    Posts
    38

    Re: How to Automatically convert simple words or phrases to symbols

    thank you, hopefully someday soon this will seem a little easier than rocket science to me.

    now that I have an example to work from I can familiarize myself with the VBA language.

  14. #14
    Registered User
    Join Date
    02-06-2017
    Location
    California, US
    MS-Off Ver
    Office 2016
    Posts
    38

    Re: How to Automatically convert simple words or phrases to symbols

    Now how would I edit this to make it effect the entire workbook?

  15. #15
    Registered User
    Join Date
    02-06-2017
    Location
    California, US
    MS-Off Ver
    Office 2016
    Posts
    38

    Re: How to Automatically convert simple words or phrases to symbols

    Disregard the last comment i believe I have figured it out.

+ 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. Formula to retrieve common phrases/words.
    By Martin2015 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 10-15-2015, 03:32 PM
  2. [SOLVED] VBA code required to Extract the content between 2 words/Phrases
    By mchilapur in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-13-2015, 01:20 AM
  3. Advanced Filter for specific words/phrases within cells
    By dsal24 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 12-18-2014, 06:33 PM
  4. [SOLVED] Can I find duplicate phrases (not just occurrences of single words)?
    By michigandrea in forum Excel Formulas & Functions
    Replies: 13
    Last Post: 04-17-2014, 09:06 AM
  5. Finding certain words and phrases in a cell
    By JakeMann in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 08-30-2013, 01:25 AM
  6. [SOLVED] how to automatically convert a number to words in Excel
    By Anil-HML in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 11-08-2005, 11:10 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