Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 33
Default import data (html files)

Ok guys I have another BIG question.
PART 1) I want to import data (html files) into a workbook from my PC
I have a program that exports html files I need to import the files to excel
then find names in differant sections of the file.
Column B contains the names
the sections of the html that seperate the names are Class:(Nitro Truck),
Class:(Monster Truck), Class:(1/8th Buggy) in excel its merged cells the row
changes depending on how many names are in each section.
I want to import the file then copy all the names to column G if the name
appears more than once put how many total times it appear next to the first
place in column G it appears in column H and delete the other duplicates. If
it appears once then just put a 1 next to it in column H
See excample of page to import at http://www.wichitarcraceway.com/eor1_4.html
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default import data (html files)


This should do what you're asking:


Code:
--------------------
Sub Import_Web_Page()
Dim strDriver, intCount, intLastrow

'Import Webpage with external data query
With ActiveSheet.QueryTables.Add(Connection:= _
"URL;http://www.wichitarcraceway.com/eor1_4.html", Destination:=Range("A1"))
.Name = "eor1_4"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.WebSelectionType = xlEntirePage
.WebFormatting = xlWebFormattingNone
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.Refresh BackgroundQuery:=False
End With

'Determine the last row of data in column A
intLastrow = Cells(65536, 1).End(xlUp).Row

'Loop through the rows
For ra = 1 To intLastrow
'Check if column B = "Name", if not copy contents column G
If Cells(ra, 2) < "Name" Then Cells(ra, 7) = Cells(ra, 2)
'Move on to next row
Next ra

'Loop through the rows
For ra = 1 To intLastrow
'Reset driver counter
intCount = 0
'Set current driver name
strDriver = Cells(ra, 7)
'Loop through the rows checking for a matching driver name
For rb = 1 To intLastrow
'If a match is found add 1 to the count
If Cells(rb, 7) = strDriver Then intCount = intCount + 1
'If a match is found and the count is greater than 1 clear the driver name in column G
If Cells(rb, 7) = strDriver And intCount 1 Then Cells(rb, 7).ClearContents
'Move on to next row
Next rb
'Enter the count against the driver name in column H
If IsEmpty(Cells(ra, 7)) = False Then Cells(ra, 8) = intCount
'Move on to next row
Next ra

End Sub
--------------------


Hope this Helps.

B

Kelly******** Wrote:
Ok guys I have another BIG question.
PART 1) I want to import data (html files) into a workbook from my PC
I have a program that exports html files I need to import the files to
excel
then find names in differant sections of the file.
Column B contains the names
the sections of the html that seperate the names are Class:(Nitro
Truck),
Class:(Monster Truck), Class:(1/8th Buggy) in excel its merged cells
the row
changes depending on how many names are in each section.
I want to import the file then copy all the names to column G if the
name
appears more than once put how many total times it appear next to the
first
place in column G it appears in column H and delete the other
duplicates. If
it appears once then just put a 1 next to it in column H
See excample of page to import at
http://www.wichitarcraceway.com/eor1_4.html



--
ben77
------------------------------------------------------------------------
ben77's Profile: http://www.excelforum.com/member.php...o&userid=35602
View this thread: http://www.excelforum.com/showthread...hreadid=558648

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 33
Default import data (html files)

Ok I ve worked on this for 2 days and cant import a html file into excel
(step 1)
any help would be great. the data import has options I dont even know what
they mean Help isnt much help for me.
can anyone atleast get me pointed in the right direction Please

"Kelly********" wrote:

Ok guys I have another BIG question.
PART 1) I want to import data (html files) into a workbook from my PC
I have a program that exports html files I need to import the files to excel
then find names in differant sections of the file.
Column B contains the names
the sections of the html that seperate the names are Class:(Nitro Truck),
Class:(Monster Truck), Class:(1/8th Buggy) in excel its merged cells the row
changes depending on how many names are in each section.
I want to import the file then copy all the names to column G if the name
appears more than once put how many total times it appear next to the first
place in column G it appears in column H and delete the other duplicates. If
it appears once then just put a 1 next to it in column H
See excample of page to import at http://www.wichitarcraceway.com/eor1_4.html

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel saving pivot table and data as html files [email protected] Excel Discussion (Misc queries) 1 December 13th 07 06:47 PM
Import HTML data into Excel - data in "1-1" format translates to J PaulT Excel Discussion (Misc queries) 2 December 6th 06 06:28 AM
Import External Data Non-HTML Table Jay637 Excel Discussion (Misc queries) 0 March 9th 06 04:37 PM
Import data from multiple excel files Arlan Excel Programming 1 December 22nd 05 08:19 PM
HTML TAGS that format Data for import into Excel Warren LaFrance Excel Programming 1 November 5th 03 03:46 PM


All times are GMT +1. The time now is 04:09 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"