![]() |
#1
|
|||
|
|||
![]()
Hi everyone,
So I have some code that takes all HTML tags out of a memo like string of text. Here is the interesting thing. This code works fine one workbook but will not work at all on a different workbook. The only difference I have between the 2 is option explicit. Here is the code that I use. Again this has worked for other workbooks. Code:
Sub StripOutHTML () 'Takes out HTML elements of a text string Dim CheckRow as integer Dim TempString as string Dim WS as worksheet Dim WB as workbook Set WB = ThisWorkbook Set WS = WB.Worksheets("Sheet1") For CheckRow = 2 to 10 WS.Range("A" & CheckRow).replace "<li>", "- " WS.Range("A" & CheckRow).replace "<*>", " " WS.Range("A" & CheckRow).replace "*>", " " WS.Range("A" & CheckRow).replace "<*>", " " WS.Range("A" & CheckRow).replace "&*;", " " TempString = WS.Range("A" & CheckRow).value WS.Range("A" & CheckRow).value = Trim(TempString) Next CheckRow msgbox "Done" End Sub Thanks in advance. |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
fprm67 | Word VBA | 11 | 04-15-2014 03:14 PM |
Find and replace No longer work | TJH | Word | 3 | 03-25-2014 11:33 PM |
![]() |
ketanco | Project | 1 | 02-11-2014 08:53 AM |
![]() |
user0044 | Project | 5 | 03-06-2012 07:28 AM |
![]() |
shabbaranks | Excel | 4 | 03-19-2011 08:38 AM |