1.xlsm

Originally Posted by
JOHN H. DAVIS
Can you attach a sample workbook?
Here is a sample file.
Sub Run()
Dim tab1 As String, tab2 As String, lastrow As Long
tab1 = Sheets("Machining").Range("f10") & " " & Sheets("Machining").Range("h10")
Sheets(tab1).Select
For i = 200 To 9 Step -1
If Cells(i, 6) = Sheets("Machining").Range("j10") And Cells(i, 12) = "As wound" Then Rows(i + 1).EntireRow.Insert
Range(Cells(i + 1, 3), Cells(i + 1, 11)).Value = Range(Cells(i, 3), Cells(i, 11)).Value
Range(Cells(i + 1, 16), Cells(i + 1, 21)).Value = Range(Cells(i, 16), Cells(i, 21)).Value
'Cells(i + 1, 12).Value = "Machined"
Next
End Sub
Seems like only only second "IF" conditions is being accounted. When i add the line
Cells(i + 1, 12).Value = "Machined"
.
It inserts "text" to all rows instead of the one for which condition is met.
I need the new inserted row to keep all formulas too
Cheers,
Stan
Bookmarks