On Error Resume Next
materialrow = Application.WorksheetFunction.Match(material, Sheets("Vysledek").Range("B:B"), False)
End Function
Public Sub soucet()
Dim rdo As Single
Dim tmp As Single
rdo = 4
For Each sh In ThisWorkbook.Sheets
If Left(sh.Name, 6) = "Export" Then
For rd = 4 To sh.UsedRange.Rows.Count + 2
tmp = materialrow(sh.Cells(rd, 2))
If tmp = 0 Then
Sheets("Vysledek").Cells(rdo, 2) = sh.Cells(rd, 2)
Sheets("Vysledek").Cells(rdo, 3) = sh.Cells(rd, 3)
Sheets("Vysledek").Cells(rdo, 4) = sh.Cells(rd, 4)
Sheets("Vysledek").Cells(rdo, 5) = sh.Cells(rd, 5)
rdo = rdo + 1
Else
Sheets("Vysledek").Cells(tmp, 4) = Sheets("Vysledek").Cells(tmp, 4) + sh.Cells(rd, 4)
End If
Next
End If
Next
End Sub
M@citovat