[COLOR="Navy"]Sub[/COLOR] MG18Oct42
[COLOR="Navy"]Dim[/COLOR] Rng [COLOR="Navy"]As[/COLOR] Range
[COLOR="Navy"]Dim[/COLOR] Dn [COLOR="Navy"]As[/COLOR] Range
[COLOR="Navy"]Dim[/COLOR] AcRng [COLOR="Navy"]As[/COLOR] Range
[COLOR="Navy"]Dim[/COLOR] nRng [COLOR="Navy"]As[/COLOR] Range
[COLOR="Navy"]Dim[/COLOR] Ac [COLOR="Navy"]As[/COLOR] Range
[COLOR="Navy"]Dim[/COLOR] c [COLOR="Navy"]As[/COLOR] [COLOR="Navy"]Long[/COLOR]
[COLOR="Navy"]Dim[/COLOR] Temp [COLOR="Navy"]As[/COLOR] [COLOR="Navy"]Long[/COLOR]
[COLOR="Navy"]Dim[/COLOR] Sht [COLOR="Navy"]As[/COLOR] Worksheet
[COLOR="Navy"]Dim[/COLOR] Tempcount [COLOR="Navy"]As[/COLOR] [COLOR="Navy"]Long[/COLOR]
c = 1
[COLOR="Navy"]Dim[/COLOR] Ray()
[COLOR="Navy"]For[/COLOR] [COLOR="Navy"]Each[/COLOR] Sht [COLOR="Navy"]In[/COLOR] Worksheets
[COLOR="Navy"]If[/COLOR] Not Sht.Name = "Summary" [COLOR="Navy"]Then[/COLOR]
[COLOR="Navy"]With[/COLOR] Sht
[COLOR="Navy"]Set[/COLOR] Rng = .Range(.Range("A3"), .Range("A" & Rows.Count).End(xlUp))
[COLOR="Navy"]Set[/COLOR] AcRng = .Range(.Range("B2"), .Cells(2, Columns.Count).End(xlToLeft))
Tempcount = Tempcount + Rng.Count * AcRng.Count
ReDim Preserve Ray(1 To 4, 1 To Tempcount)
Ray(1, 1) = "Item": Ray(2, 1) = "Quantity": Ray(3, 1) = "Date": Ray(4, 1) = "Sht.Name"
Temp = 0
[COLOR="Navy"]For[/COLOR] [COLOR="Navy"]Each[/COLOR] Dn [COLOR="Navy"]In[/COLOR] Rng
[COLOR="Navy"]For[/COLOR] [COLOR="Navy"]Each[/COLOR] Ac [COLOR="Navy"]In[/COLOR] Dn.Offset(, 1).Resize(, AcRng.Count)
[COLOR="Navy"]If[/COLOR] Not IsEmpty(Ac) [COLOR="Navy"]Then[/COLOR]
c = c + 1
Ray(1, c) = Dn
Ray(2, c) = Ac
Ray(3, c) = CDbl(DateValue(.Cells(2, Ac.Column)))
Ray(4, c) = Sht.Name
[COLOR="Navy"]End[/COLOR] If
[COLOR="Navy"]Next[/COLOR] Ac
[COLOR="Navy"]If[/COLOR] Temp = c [COLOR="Navy"]Then[/COLOR]
c = c + 1
Ray(1, c) = Dn
Ray(2, c) = 0
Ray(4, c) = Sht.Name
[COLOR="Navy"]End[/COLOR] If
Temp = c
[COLOR="Navy"]Next[/COLOR] Dn
[COLOR="Navy"]End[/COLOR] With
[COLOR="Navy"]End[/COLOR] If
[COLOR="Navy"]Next[/COLOR] Sht
[COLOR="Navy"]With[/COLOR] Sheets("Summary")
.Range("A1").Resize(c, 4) = Application.Transpose(Ray)
.Columns("C:C").NumberFormat = "dd/mm/yyyy"
[COLOR="Navy"]End[/COLOR] [COLOR="Navy"]With[/COLOR]
[COLOR="Navy"]End[/COLOR] [COLOR="Navy"]Sub[/COLOR]