Лист1
Название цена Заказ Сума
Комп 1000 1 1000
Комп2 2000 0 2000
Комп3 3000 2 3000
Лист2
Комп 1000 1000
Комп3 3000 3000

Модератор: Naeel Maqsudov
Код: Выделить всё
Sub qwe()
Dim row As Range, sh As Worksheet, V As Variant, N As Long
Set sh = Application.ActiveWorkbook.Sheets("Лист2")
N = Application.WorksheetFunction.Count(sh.Columns(1)) + 1
For Each row In Application.ActiveWorkbook.Sheets("Лист1").Cells(1, 1).CurrentRegion.Rows
V = row.Cells(1, 3).Value
If IsNumeric(V) And V >= 1 Then row.Copy sh.Cells(N, 1): N = N + 1
Next
Set sh = Nothing
End Sub
Shell Function
Runs an executable program and returns a Variant (Double) representing the program's task ID if successful, otherwise it returns zero.
Syntax:
Shell(pathname[,windowstyle])
Код: Выделить всё
Sub rty()
Dim row As Range, sh As Worksheet, V As Variant, N As Long
Set sh = Application.ActiveWorkbook.Sheets("Лист4")
N = Application.WorksheetFunction.Count(sh.Columns(1)) + 1
For Each row In Application.ActiveWorkbook.Sheets("Лист3").Cells(1, 1).CurrentRegion.Rows
V = row.Cells(1, 3).Value
If IsNumeric(V) And V >= 1 Then row.Copy sh.Cells(N, 1): N = N + 1
Next
Set sh = Nothing
End Sub