![]() |
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 |
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 |
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 |
All times are GMT +1. The time now is 10:25 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com