Solved

importing htm files into excel sheet using VB

Posted on 2003-11-18
4
145 Views
Last Modified: 2010-05-03
hi,

i would like to write a macro inside a excel table, which do the following things.
say i have a folder contains several html files.

i want to import the file names, the characters from all the html files ("the source code"),
and then filter the texts i want.

e.g.
a html file contains:
<table>
<tr>
<td>hello</td>
<td>bye</td>
</tr>
</table>

i want to search the character ">" and copy all the text after it till i find "<",
like ">"hello"<", i want to have hello which is between ">" and "<".

any body could help me? thanx.
0
Comment
Question by:stustatester
4 Comments
 
LVL 26

Accepted Solution

by:
EDDYKT earned 30 total points
Comment Utility
Dim arr1, arr2
Dim I As Long
Dim str As String

str = "<table><tr><td>hello</td><td>bye</td></tr></table>"
arr1 = Split(str, "<td>")
For I = 1 To UBound(arr1)
    arr2 = Split(arr1(I), "<")
    Debug.Print arr2(0)
    Erase arr2
Next
Erase arr1
0
 
LVL 49

Expert Comment

by:DanRollins
Comment Utility
Moderator, my recommended disposition is:

    Accept EDDYKT's comment(s) as an answer.

Dan Rollins -- EE database cleanup volunteer
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now