mysticmario
Active Member
- Joined
- Nov 10, 2021
- Messages
- 323
- Office Version
- 365
- Platform
- Windows
I have this code
For some reason line:
Range(cell.Offset(0, -5), cell.Offset(0, -4), cell.Offset(0, -3), cell.Offset(0, 2)).Copy does not work dunno why.
Can someone help me a little?
VBA Code:
Private Sub CommandButton1_Click()
Dim rng As Range, cell As Range, lr As Long
Set rng = Range("H144:H174")
For Each cell In rng
If Not IsEmpty(cell) And cell.Value <> 0 Then
Range(cell.Offset(0, -5), cell.Offset(0, -4), cell.Offset(0, -3), cell.Offset(0, 2)).Copy
lr = Sheets("Lista materiałowa").Cells(Rows.Count, "B").End(xlUp).Row
Sheets("Lista materiałowa").Cells(lr + 1, "B").PasteSpecial Paste:=xlPasteValues
Else
MsgBox "No data"
End If
Next cell
End Sub
For some reason line:
Range(cell.Offset(0, -5), cell.Offset(0, -4), cell.Offset(0, -3), cell.Offset(0, 2)).Copy does not work dunno why.
Can someone help me a little?