test 1

Add to Favorites

Code:

Sub Convert_Html_Entities()
''''''''''''''  TeachExcel.com  ''''''''''''''
'Convert HTML Entities into readable text.

Application.ScreenUpdating = False

For Each c In Selection

    'Replace the entities - one per line.
    c.Value = Replace(c.Value, """, """")
    c.Value = Replace(c.Value, "&", "&")
    c.Value = Replace(c.Value, "'", "'")
    c.Value = Replace(c.Value, "&lt;", "<")
    c.Value = Replace(c.Value, "&gt;", ">")
    c.Value = Replace(c.Value, "&nbsp;", " ")
    c.Value = Replace(c.Value, "&iexcl;", "¡")
    c.Value = Replace(c.Value, "&cent;", "¢")
    c.Value = Replace(c.Value, "&pound;", "£")
    c.Value = Replace(c.Value, "&curren;", "¤")
    c.Value = Replace(c.Value, "&yen;", "¥")
    c.Value = Replace(c.Value, "&brvbar;", "¦")
    c.Value = Replace(c.Value, "&sect;", "§")
    c.Value = Replace(c.Value, "&uml;", "¨")
    c.Value = Replace(c.Value, "&copy;", "©")
    c.Value = Replace(c.Value, "&ordf;", "ª")
    c.Value = Replace(c.Value, "&laquo;", "«")
    c.Value = Replace(c.Value, "&not;", "¬")
    c.Value = Replace(c.Value, "&reg;", "®")
    c.Value = Replace(c.Value, "&macr;", "¯")
    c.Value = Replace(c.Value, "&deg;", "°")
    c.Value = Replace(c.Value, "&plusmn;", "±")
    c.Value = Replace(c.Value, "&sup2;", "²")
    c.Value = Replace(c.Value, "&sup3;", "³")
    c.Value = Replace(c.Value, "&acute;", "´")
    c.Value = Replace(c.Value, "&micro;", "µ")
    c.Value = Replace(c.Value, "&para;", "¶")
    c.Value = Replace(c.Value, "&middot;", "·")
    c.Value = Replace(c.Value, "&cedil;", "¸")
    c.Value = Replace(c.Value, "&sup1;", "¹")
    c.Value = Replace(c.Value, "&ordm;", "º")
    c.Value = Replace(c.Value, "&raquo;", "»")
    c.Value = Replace(c.Value, "&frac14;", "¼")
    c.Value = Replace(c.Value, "&frac12;", "½")
    c.Value = Replace(c.Value, "&frac34;", "¾")
    c.Value = Replace(c.Value, "&iquest;", "¿")
    c.Value = Replace(c.Value, "&Agrave;", "À")
    c.Value = Replace(c.Value, "&Aacute;", "Á")
    c.Value = Replace(c.Value, "&Acirc;", "Â")
    c.Value = Replace(c.Value, "&Atilde;", "Ã")
    c.Value = Replace(c.Value, "&Auml;", "Ä")
    c.Value = Replace(c.Value, "&Aring;", "Å")
    c.Value = Replace(c.Value, "&AElig;", "Æ")
    c.Value = Replace(c.Value, "&Ccedil;", "Ç")
    c.Value = Replace(c.Value, "&Egrave;", "È")
    c.Value = Replace(c.Value, "&Eacute;", "É")
    c.Value = Replace(c.Value, "&Ecirc;", "Ê")
    c.Value = Replace(c.Value, "&Euml;", "Ë")
    c.Value = Replace(c.Value, "&Igrave;", "Ì")
    c.Value = Replace(c.Value, "&Iacute;", "Í")
    c.Value = Replace(c.Value, "&Icirc;", "Î")
    c.Value = Replace(c.Value, "&Iuml;", "Ï")
    c.Value = Replace(c.Value, "&ETH;", "Ð")
    c.Value = Replace(c.Value, "&Ntilde;", "")
    c.Value = Replace(c.Value, "&Ograve;", "")
    c.Value = Replace(c.Value, "&Oacute;", "")
    c.Value = Replace(c.Value, "&Ocirc;", "")
    c.Value = Replace(c.Value, "&Otilde;", "Õ")
    c.Value = Replace(c.Value, "&Ouml;", "Ö")
    c.Value = Replace(c.Value, "&times;", "")
    c.Value = Replace(c.Value, "&Oslash;", "Ø")
    c.Value = Replace(c.Value, "&Ugrave;", "Ù")
    c.Value = Replace(c.Value, "&Uacute;", "Ú")
    c.Value = Replace(c.Value, "&Ucirc;", "Û")
    c.Value = Replace(c.Value, "&Uuml;", "Ü")
    c.Value = Replace(c.Value, "&Yacute;", "Ý")
    c.Value = Replace(c.Value, "&THORN;", "Þ")
    c.Value = Replace(c.Value, "&szlig;", "ß")
    c.Value = Replace(c.Value, "&agrave;", "à")
    c.Value = Replace(c.Value, "&aacute;", "á")
    c.Value = Replace(c.Value, "&acirc;", "â")
    c.Value = Replace(c.Value, "&atilde;", "ã")
    c.Value = Replace(c.Value, "&auml;", "ä")
    c.Value = Replace(c.Value, "&aring;", "å")
    c.Value = Replace(c.Value, "&aelig;", "æ")
    c.Value = Replace(c.Value, "&ccedil;", "ç")
    c.Value = Replace(c.Value, "&egrave;", "è")
    c.Value = Replace(c.Value, "&eacute;", "é")
    c.Value = Replace(c.Value, "&ecirc;", "ê")
    c.Value = Replace(c.Value, "&euml;", "ë")
    c.Value = Replace(c.Value, "&igrave;", "ì")
    c.Value = Replace(c.Value, "&iacute;", "í")
    c.Value = Replace(c.Value, "&icirc;", "î")
    c.Value = Replace(c.Value, "&iuml;", "ï")
    c.Value = Replace(c.Value, "&eth;", "ð")
    c.Value = Replace(c.Value, "&ntilde;", "ñ")
    c.Value = Replace(c.Value, "&ograve;", "ò")
    c.Value = Replace(c.Value, "&oacute;", "ó")
    c.Value = Replace(c.Value, "&ocirc;", "ô")
    c.Value = Replace(c.Value, "&otilde;", "õ")
    c.Value = Replace(c.Value, "&ouml;", "ö")
    c.Value = Replace(c.Value, "&divide;", "÷")
    c.Value = Replace(c.Value, "&oslash;", "ø")
    c.Value = Replace(c.Value, "&ugrave;", "ù")
    c.Value = Replace(c.Value, "&uacute;", "ú")
    c.Value = Replace(c.Value, "&ucirc;", "û")
    c.Value = Replace(c.Value, "&uuml;", "ü")
    c.Value = Replace(c.Value, "&yacute;", "ý")
    c.Value = Replace(c.Value, "&thorn;", "þ")
    c.Value = Replace(c.Value, "&yuml;", "ÿ")
    c.Value = Replace(c.Value, "&OElig;", "")
    c.Value = Replace(c.Value, "&oelig;", "")
    c.Value = Replace(c.Value, "&Scaron;", "Š")
    c.Value = Replace(c.Value, "&scaron;", "š")
    c.Value = Replace(c.Value, "&Yuml;", "Ÿ")
    c.Value = Replace(c.Value, "&fnof;", "")
    c.Value = Replace(c.Value, "&circ;", "ˆ")
    c.Value = Replace(c.Value, "&tilde;", "˜")
    c.Value = Replace(c.Value, "&thinsp;", "")
    c.Value = Replace(c.Value, "&zwnj;", "")
    c.Value = Replace(c.Value, "&zwj;", "")
    c.Value = Replace(c.Value, "&lrm;", "")
    c.Value = Replace(c.Value, "&rlm;", "")
    c.Value = Replace(c.Value, "&ndash;", "")
    c.Value = Replace(c.Value, "&mdash;", "")
    c.Value = Replace(c.Value, "&lsquo;", "‘")
    c.Value = Replace(c.Value, "&rsquo;", "’")
    c.Value = Replace(c.Value, "&sbquo;", "‚")
    c.Value = Replace(c.Value, "&ldquo;", "“")
    c.Value = Replace(c.Value, "&rdquo;", "”")
    c.Value = Replace(c.Value, "&bdquo;", "„")
    c.Value = Replace(c.Value, "&dagger;", "†")
    c.Value = Replace(c.Value, "&Dagger;", "‡")
    c.Value = Replace(c.Value, "&bull;", "•")
    c.Value = Replace(c.Value, "&hellip;", "…")
    c.Value = Replace(c.Value, "&permil;", "‰")
    c.Value = Replace(c.Value, "&lsaquo;", "‹")
    c.Value = Replace(c.Value, "&rsaquo;", "›")
    c.Value = Replace(c.Value, "&euro;", "€")
    c.Value = Replace(c.Value, "&trade;", "™")

Next c

Application.ScreenUpdating = True

End Sub

no more code






Similar Content on TeachExcel
Get the Day of the Week (1 to 7) for a Date in Excel - WEEKDAY
Tutorial: Use a function in Excel to get the number of the day in a week, from 1 to 7.  This allow...
Filter Data in Excel to Display Results that Contain 1 of 2 Possible Values - AutoFilter
Macro: This Excel macro filters data in Excel to display results that contain 1 of 2 possible val...
Sum Values that Equal 1 of Many Conditions across Multiple Columns in Excel
Tutorial: How to Sum values using an OR condition across multiple columns, including using OR with ...
video 1
: body video 1...
Sum Values that Meet 1 of Multiple Conditions in Excel
Tutorial: How to sum values that equal one of many potential criteria; this is basically summing wi...
Pass Values from One Macro to Another Macro
Tutorial: How to pass variables and values to macros. This allows you to get a result from one macr...



How to Install the Macro
  1. Select and copy the text from within the grey box above.

  2. Open the Microsoft Excel file in which you would like the Macro to function.

  3. Press "Alt + F11" - This will open the Visual Basic Editor - Works for all Excel Versions.  Or For other ways to get there, Click Here.

  4. On the new window that opens up, go to the left side where the vertical pane is located. Locate your Excel file; it will be called VBAProject (YOUR FILE'S NAME HERE) and click this.

  5. If the Macro goes in a Module, Click Here, otherwise continue to Step 8.

  6. If the Macro goes in the Workbook or ThisWorkbook, Click Here, otherwise continue to Step 8.

  7. If the Macro goes in the Worksheet Code, Click Here, otherwise continue to Step 8.

  8. Close the Microsoft Visual Basic Editor window and save the Excel file. When you close the Visual Basic Editor window, the regular Excel window will not close.

  9. You are now ready to run the macro.


Tutorial Details
Similar Content
Get the Day of the Week (1 to 7) for a Date in Excel - WEEKDAY
Tutorial: Use a function in Excel to get the number of the day in a week, from 1 to 7.  This allow...
Filter Data in Excel to Display Results that Contain 1 of 2 Possible Values - AutoFilter
Macro: This Excel macro filters data in Excel to display results that contain 1 of 2 possible val...
Sum Values that Equal 1 of Many Conditions across Multiple Columns in Excel
Tutorial: How to Sum values using an OR condition across multiple columns, including using OR with ...
Excel Forum