I want to strip all the html away from the left and right of the textual value:
I have this...
<option value="41">GECommonUI</option>
I want to get this...
GECommonUI
I want to strip all the html away from the left and right of the textual value:
I have this...
<option value="41">GECommonUI</option>
I want to get this...
GECommonUI
in excel
select all
open replace (ctrl+f)
replace <>
with nothing
or use perl regex
$line = "This is some text with HTML and words";
$line =~ s/<(.?)>//gi;
Set a reference to MS Forms 2.0 to use the DataObject object.
Public Function StripHTML(sInput As String) As String
Dim rTemp As Range
Dim oData As DataObject
Set oData = New DataObject
oData.SetText "<html><style>br{mso-data-placement:same-cell;}</style>" & sInput & "</html>"
oData.PutInClipboard
Set rTemp = Workbooks.Add.Worksheets(1).Range("a1")
rTemp.Parent.PasteSpecial "Unicode Text"
StripHTML = rTemp.Text
rTemp.Parent.Parent.Close False
Set rTemp = Nothing
Set oData = Nothing
End Function
See http://www.dailydoseofexcel.com/archives/2005/02/23/html-in-cells-ii/ for more info.
guys this is a simple set of string functions. as i am not up to speed on excel string functions this is a pain for me to figure out...
in a programing language this would go somethign like mid(start, length) to get the value from the full html string- the trick is to get the length as the start possition minus the lenth of th ending html lenght)
mid( pos(">")+2, len(string)-pos(">") )