I've run the newest version and gotten no result - tell me, should there be entries generated from this dataset and, if so, what should they be - just one entry can get me rolling again
Sub Webber(): Dim Cust As String, w2 As Worksheet, w1 As Worksheet
Dim r As Long, n As Long, c As Long, ec As Long, I, J, Z
Set w1 = Sheets("Sheet1")
ec = w1.Columns.Find("*", , , , xlByColumns, xlPrevious).column
With CreateObject("Scripting.Dictionary")
For Each w2 In Worksheets
If w2.name <> w1.name Then
For r = 3 To w2.Range("A" & Rows.Count).End(xlUp).row: Cust = w2.Range("A" & r)
If Cust <> "" Then
If .Item(Cust) = "" Then
.Item(Cust) = w2.Range("E" & r) & "~" & w2.Range("G" & r)
Else:
.Item(Cust) = .Item(Cust) & "|" & w2.Range("E" & r) & "~" & w2.Range("G" & r)
End If: End If
I = .Item(Cust): Next r: End If: Next w2
r = 3: Do Until Cust = "": Cust = Range("A" & r)
If .Exists(Cust) Then
I = .Item(Cust): Z = Split(I, "|")
For c = 4 To ec
If IsDate(w1.Cells(r, c + 1)) Then
J = w1.Cells(r, c) & "~" & w1.Cells(r, c + 1)
For n = 0 To UBound(Z)
If Split(Z(n), "~")(1) <= Split(J, "~")(1) Then GoTo GetNext
w1.Range("A" & r + 1).EntireRow.Insert
w1.Cells(r, c).Resize(1, 2) = Split(Z(n), "~"): r = r + 1
Next n: End If
GetNext: Next c
End If: r = r + 1: Loop
End With
End Sub
Bookmarks