Hi Excel Experts,
Recently, I posted similar subject and I got the perfect answer from Marc L via below link:-
Transpose Data
I had clicked as Solved as it has perfectly done for my web data for Work Orders. However, I couldn't get it to do the same for my Incidents. I didn't give the samples from Incidents earlier because I saw from browser view they're displayed just the same, just that Incidents is saved under extension .html (which I understood no diff with .htm files) and have only 5 fields instead of 6(exclude the Communication Source)(which I thought I could just do minor modification in the given macro to suit that).
But, I have tried couple of days now, I still didn't get it to paste from web data Incidents. The macro will run without errors, but no output for Incidents, only Work Orders.
Below is the given macro and attached are the samples of Web Data for both Work Order and Incident accordingly for your kind perusal.
Aside to the above, if it's not so much trouble, I would like to ask if the macro can give output to the next sheet instead of strictly in Sheet1 only because I would like to park the macro action buttons in Sheet1, but the populated output should be in the new worksheet. I'm totally not used to the "usedrange" command, so whichever my trials and erros on changing the given codes were not succeeded.
Sub Demo1()
Dim L&, P$, F$, Rg As Range, R&
Me.UsedRange.Offset(1).Clear
Application.ScreenUpdating = False
L = 1
P = ThisWorkbook.Path & "\Sample Source Data\"
F = Dir(P & "*.htm")
While F > ""
With Workbooks.Open(P & F).Worksheets(1).UsedRange.Columns(1)
Set Rg = .Find("Work Order ID", , xlValues, xlWhole)
If Not Rg Is Nothing Then
R = Rg.Row
Do
With Rg.CurrentRegion.Rows
V = Application.Index(.Columns(2), [COLUMN(A:F)])
If .Count > 6 Then V(6) = Join(Application.Index(.Item("6:" & .Count).Columns(2), _
Evaluate("COLUMN(" & [A1].Resize(, .Count - 5).Address & ")")), vbLf)
End With
L = L + 1
Cells(L, 1).Resize(, 6).Value = V
Set Rg = .FindNext(Rg)
Loop While Rg.Row > R
End If
.Parent.Parent.Close False
End With
F = Dir
Wend
Set Rg = Nothing
Application.ScreenUpdating = True
End Sub
Appreciate your help.
Thanks in advance.
DZ
Bookmarks