PDA

View Full Version : Extracting data from html files (within certaing tags) into Excel file



asset
10-03-2013, 10:03 AM
Hello!

I have many PO files. In each PO there are certain text parts which I want to extract into Excel file.
Each PO file includes following:
1. <span class="jobname">job name here</span>
2. <span class="jobcode">job code here</span>
3. div class="gnumb">Purchase Order <span id="gnumb">alphanumeric PO number here</span></div>
4. <div class="totals">PO Total: <span id="pototal">$ sum here </span></div>

I need a VBA macro that will extract text withing each tag and place each part on one cell of one row.
For example, 1 on cell A:1, 2 on cell B:1, 3 on cell C:1 and 4 on cell D:1 and so on.
And at the end I should have 4 columns and many rows.

Can someone help create a macro for this?