I copy and paste data from a webpage. The webpage has changed its format. The macros formula I use to sort the data from webpage no longer works. Can someone please adjust the macros code to adjust to the new data format? I would like the data in Column A sorted into the format in cells in Columns C thru J. Thanks in advance!
Option Explicit
Sub sortdata()
Dim a(), b()
Dim i As Long, k As Long, lr As Long
lr = Range("A" & Rows.Count).End(xlUp).Row
a = Range("A1:A" & lr).Value
ReDim b(1 To UBound(a, 1), 1 To 8)
For i = 1 To UBound(a, 1) Step 25
If a(i, 1) <> "Spread" Then Exit For
k = k + 1
b(k, 1) = a(i + 21, 1)
b(k, 2) = a(i + 4, 1)
b(k, 3) = a(i + 5, 1)
b(k, 4) = a(i + 6, 1)
b(k, 5) = a(i + 7, 1)
b(k, 6) = a(i + 8, 1)
b(k, 7) = a(i + 9, 1)
b(k, 8) = a(i + 10, 1)
k = k + 1
b(k, 2) = a(i + 12, 1)
b(k, 3) = a(i + 13, 1)
b(k, 4) = a(i + 14, 1)
b(k, 5) = a(i + 15, 1)
b(k, 6) = a(i + 16, 1)
b(k, 7) = a(i + 17, 1)
b(k, 8) = a(i + 18, 1)
Next
Range("C2").Resize(k, UBound(b, 2)).Value = b
Range("C2").Resize(k).NumberFormat = "h:mm AM/PM"
End Sub
MacroFix.xlsx
Bookmarks