jalrs
Active Member
- Joined
- Apr 6, 2022
- Messages
- 300
- Office Version
- 365
- Platform
- Windows
Good morning guys,
I would like to delete the entire row if my column M cells are equal to 0,000, starting on row 2.
I would also like to add a new line, immediately under the one where the condition is met, if my column K cells are greater than the matching column L cells.
My code is as follows:
Any help is greatly appreciated.
Thanks!
I would like to delete the entire row if my column M cells are equal to 0,000, starting on row 2.
I would also like to add a new line, immediately under the one where the condition is met, if my column K cells are greater than the matching column L cells.
My code is as follows:
VBA Code:
Sub play()
Dim livro1 As Workbook
Dim folha1 As Worksheet
Dim folha2 As Worksheet
Dim ultimalinha1 As Long
Set livro1 = ThisWorkbook
Set folha1 = livro1.Worksheets("ZPO1")
Set folha2 = livro1.Worksheets("Play")
ultimalinha1 = folha1.Cells(Rows.Count, "A").End(xlUp).Row
folha2.UsedRange.Offset(1).Cells.ClearContents
With folha1
.Range("A2:O" & ultimalinha1).Copy
folha2.Cells(2, 1).PasteSpecial Paste:=xlPasteFormats
folha2.Cells(2, 1).PasteSpecial Paste:=xlPasteValues
End With
Application.CutCopyMode = False
folha2.Activate
folha2.Range("A2").Select
End Sub
Any help is greatly appreciated.
Thanks!