View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Dick Kusleika[_4_] Dick Kusleika[_4_] is offline
external usenet poster
 
Posts: 595
Default HTML parsing with VBA

wrote:
Thhanks Dick. That worked without any errors. But now it seems as
though the macro is not searching the entire row. The file has 90
columns and up to 1400 rows. Many of the cells contain several HTML
tags and not all are being replaced with "". Also, some tags are
preceded by a few spaces, these are not being replaced either. Do you
have any advice? Thanks.


This worked for me

Sheet1.Rows("1:52").Replace "<*", "", xlPart, xlByRows, False, , False,
False

replace the 52 with whichever number of rows you want.

I don't know why it wouldn't replace all the tags. Maybe you can post an
example of one it's not replacing. It won't replace spaces unless you tell
it to. You could repeat the above line three times to catch when there are
two preceding spaces.

Sheet1.Rows("1:52").Replace " <*", "", xlPart, xlByRows, False, , False,
False
Sheet1.Rows("1:52").Replace " <*", "", xlPart, xlByRows, False, , False,
False
Sheet1.Rows("1:52").Replace "<*", "", xlPart, xlByRows, False, , False,
False

The first one looks for two spaces, then one, then none.

--
Dick Kusleika
MS MVP - Excel
www.dailydoseofexcel.com