Replace this:
If Not rngF Is Nothing Then
wsW.Rows(lngR + 1).EntireRow.Insert
wsW.Cells(lngR + 1, "H").Value = wsW.Cells(lngR, "I").Value
wsW.Cells(lngR + 1, "I").Value = wsRM.Cells(rngF.Row, "F").Value
wsW.Cells(lngR + 1, "K").Value = wsRM.Cells(rngF.Row, "G").Value
wsW.Cells(lngR + 1, "M").Value = wsRM.Cells(rngF.Row, "I").Value
wsW.Cells(lngR + 1, "N").Value = wsRM.Cells(rngF.Row, "E").Value
End If
With this:
If Not rngF Is Nothing Then
If wsRM.Cells(lngR, "F").Value <> "" Then
wsW.Rows(lngR + 1).EntireRow.Insert
wsW.Cells(lngR + 1, "H").Value = wsW.Cells(lngR, "I").Value
wsW.Cells(lngR + 1, "I").Value = wsRM.Cells(rngF.Row, "F").Value
wsW.Cells(lngR + 1, "K").Value = wsRM.Cells(rngF.Row, "G").Value
wsW.Cells(lngR + 1, "M").Value = wsRM.Cells(rngF.Row, "I").Value
wsW.Cells(lngR + 1, "N").Value = wsRM.Cells(rngF.Row, "E").Value
End If
End If
Not sure what you want to do with M and N values - add them to the original row as well as the new row?
Bookmarks