Home |
Search |
Today's Posts |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Without having access to the webpage and the complete code I can't dubug the problem for you. I added some message boxes to the code below. I think your problem may be the row and column headers on the worksheet don't exactly match the ones on the webpage. You may have extra spaces, other white characters in the headers ( webpage or worksheet), or some of the characters may be capitalized. Sometimes adding a TRIM or forcing all the the to UPPERCASE using the function UCASE solves these problems. VBA Code: -------------------- For Each mRow In mTable.Rows ColCount = 0 For Each mCol In mRow if ColCount = 0 then RowHeader = mCol Else ColHeader = mTable.Rows(0).cells(ColCount) With Wks Set rngC = .Columns(1).Find(What:=RowHeader, _ LookAt:=xlPart, LookIn:=xlValues) if not rngC is nothing then Set rngR = .Rows(1).Find(What:=ColHeader, _ LookAt:=xlPart, LookIn:=xlValues) if rngR is nothing then msgbox("Row Header : " & RowHeader & vbcrlf & _ "Column Header : " & ColHeader) else .Cells(rngC.Row,rngR.column) = mCol.innertext end if else msgbox("Cannot find row Header : " & RowHeader) end if End With End if ColCount = ColCount + 1 next mCol next mRow -------------------- -- joel ------------------------------------------------------------------------ joel's Profile: http://www.thecodecage.com/forumz/member.php?u=229 View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=199824 http://www.thecodecage.com/forumz |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Convert hard coded query criteria to Parameter Query | Excel Discussion (Misc queries) | |||
Excel 2007 / MS Query - editing existing query to another sheet | Excel Discussion (Misc queries) | |||
Anyone Else Use Database Query to Query Another Sheet in the Same Excel Workbook? | Excel Discussion (Misc queries) | |||
How to use a Access Query that as a parameter into Excel database query | Excel Discussion (Misc queries) | |||
Problem with .Background Query option of ODBC Query | Excel Programming |