With Application
.EnableEvents = False
.ScreenUpdating = False
.Calculation = xlManual
End With
Dim rdR As Long, rdW As Long
Dim Material As String, Stredisko As String
With Sheets("VÝSTUP")
rdW = .Cells(Cells.Rows.Count, 1).End(xlUp).Row
If rdW = 1 Then rdW = 2
Range(.Cells(2, 1), .Cells(rdW, 4)).ClearContents
End With
Material = Sheets("VSTUP").Cells(3, 2)
Stredisko = Sheets("VSTUP").Cells(6, 2)
With Sheets("DATABAZA")
rdW = 1
For rdR = 2 To .Cells(Cells.Rows.Count, 1).End(xlUp).Row
If .Cells(rdR, 1) = Material Then
rdW = rdW + 1
Sheets("VÝSTUP").Cells(rdW, 1) = .Cells(rdR, 1)
Sheets("VÝSTUP").Cells(rdW, 2) = .Cells(rdR, 2)
Sheets("VÝSTUP").Cells(rdW, 3) = .Cells(rdR, 3)
Sheets("VÝSTUP").Cells(rdW, 4) = Stredisko
End If
Next rdR
End With
With Application
.EnableEvents = True
.ScreenUpdating = True
.Calculation = xlAutomatic
End With
End Sub
citovat

RSS nejnovější články