I have a Data with HTML tags in excel sheet like below:
<b>This is test data<br>Nice
<div> Go on this is next Cell
Very goood <b>.....</b>
SO, Basically I want to delete or replace all html tags with space in excel sheet.
I have a Data with HTML tags in excel sheet like below:
<b>This is test data<br>Nice
<div> Go on this is next Cell
Very goood <b>.....</b>
SO, Basically I want to delete or replace all html tags with space in excel sheet.
Open VBA in Excel (Alt +F11), click on the project name (spreadsheet name) in the project explorer on the right. Insert -> New Module. Paste the user defined function below into the module Window. Save as .XLSM which allow Macros.
type the function '=StripHTML(A2)' assuming your data is in cell A2. You can also download a working example here:
http://jfrancisconsulting.com/how-to-strip-html-tags-in-excel/
Apply
Replace All
with<*>
pattern:To open this go to Ribbon
Home > Find & Select > Replace...
or simply press CTRL+H.Extra spaces may be further removed using
TRIM
function. Good luck!Since the macro above didn't work for me I fixed it myself. It's my first script, if you guys can improve it, make it faster, add more then you're more than welcome!
Ok guys, I've had no previous experience programming (except for some very basic Java 6 years ago) but with some help, lots of guessing (hours actually) I managed to make this script, it works like a charm to remove most and 8#text but it does not replace
<BR>
with linebreak (you can do this by hitting CTRL + H, "find:<br>
" "replace: (now hold ALT down and use type 0010 with your NUMPAD. A small dot should be blinking in the replace window, then hit "replace all").Paste the code below into a user module (alt +f11, right click Sheet1->insert->Module->paste code)
And make a button by going File->Options->Customize Ribbon-> check the Developer checkbox. Then go to developer tab->Insert->Button-> then place the button and right click->assign macro-> Choose RemoveTags.