You are on page 1of 1

Sub macrodelete()

Dim lastrow, lastcol, i, j As Long


Dim r As Integer

r = 10
lastrow = 4
lastcol = Worksheets("sheet8").Cells(1, Column.Count).End(xlToLeft).Column
Stop
For i = 3 To lastcol

For j = 3 To 6
If Cells(j, i) <> "NA" Then
Cells(j, i).Copy Range("A" & r).PasteSpecial
r=r+1
End If
Next j
Next i

End Sub

Sub Rectangle1_Click()

Dim last As Integer


Dim i As Integer

last = Worksheets("sheet8").Cells(Rows.Count, "A").End(xlUp).Row


For i = last To 1 Step -1
If (Cells(i, "A").Value) = "NA" Then
Cells(i, "A").EntireRow.delete
End If
Next i
End Sub

You might also like