VBA to extract part of HTML code

smide

Board Regular
Joined
Dec 20, 2015
Messages
152
Office Version
2007
Platform
Windows
Hello.


In cell A1 I'm receiving Customer names an their home town in form of huge HTML code.
I need to extract Customer names in column A (A3:A600) and their home towns in column B (B3:B600).

Part of HTML code for names is always the same:
HTML:
<div class="customName--1gBeC">J. Jones</div>
Part of code for towns is also always the same:
HTML:
<td class="search-results-table-column-town ">Sydney</td>

Basically I need to extract somehow only part between
HTML:
1gBeC">
and
HTML:
</div>
for Name and part between
HTML:
column-town ">
and
HTML:
</td>
for Town.


I'm using excel 2007.

example.

AB
1HTML code
2
3J. JonesSydney
4C. DuncanToronto
5M. WeberMünchen
6........

<tbody>
</tbody>
 
Last edited:

Some videos you may like

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.

Forum statistics

Threads
1,089,557
Messages
5,408,947
Members
403,245
Latest member
Nanda Kishore

This Week's Hot Topics

  • help please
    SORRY NOT ANY GOOD AT EXCEL SO HELP WOULD BE MUCH APPRECIATED this formula is in a sheet called ignore...
  • two formulas needed
    Hello, I'll try my best to explain this: First formula needed in Sheet1 cell A2: If Sheet1 cell B2 = Sheet2 cell B2 then return a 1. If not then...
  • Dynamic Counts
    Good afternoon, we are tidying up some data & the data seems to be growing quicker than we are tidying it up! What we confirm (by reviewing it...
  • Help Excel formula eliminate duplicate values and keep only 2 identical rows.
    as picture below column A has a duplicate value. but the values are not the same as the rule. sometimes 4 rows, sometimes 10 rows or 7 or 9...
  • Macro Compile Error Sub or Function not defined
    Hello, I am trying to run macros from a validation list, all macros have been created and run perfectly on there own but I'm getting a compile...
  • Last row combined with Current Region VBA
    I'm generally happy finding the last row of data through something like Lastrow = Cells(Rows.Count, "D").End(xlUp) but I don't always receive data...
Top