Hi all,
This macro was made to find all values 20 steps before everytime it meets the first empty cells(after a bunch of filleds) in Column M. And I would like to copy all these values found and paste them on Column H in order. Can anyone help me simplify this code?
Also, This line/function
"Selection.Copy Destination:=Cells(i, 8)" doesn't really copy and paste, but cut and paste instead. I do not want to cut off any of the cells, can anyone help me to find out why this is happening?
This macro was made to find all values 20 steps before everytime it meets the first empty cells(after a bunch of filleds) in Column M. And I would like to copy all these values found and paste them on Column H in order. Can anyone help me simplify this code?
Also, This line/function
"Selection.Copy Destination:=Cells(i, 8)" doesn't really copy and paste, but cut and paste instead. I do not want to cut off any of the cells, can anyone help me to find out why this is happening?
Code:
Dim i As Long, LastRow As Long
LastRow = Range("B65536").End(xlUp).Row - 200
If Not LastRow < 1 Then
For i = 14 To LastRow
If Not IsEmpty(Cells(i - 1, 13)) And IsEmpty(Cells(i, 13)) Then Cells(i - 20, 13).Select
Selection.Copy Destination:=Cells(i, 8)
Selection = ""
Next i
End If
Columns("H:H").SpecialCells(xlCellTypeBlanks).Delete (xlShiftUp)
End Sub