A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
Oops - spaced on that part ;) Not sure what you wanted, so here are three different versions:
This version will change the values of the original row after it has been copied:
Sub TryMe2()
Dim lngR As Long
For lngR = 1 To Cells(Rows.Count,1).End(xlUp).Row
If Cells(lngR,"B").Value = "Y" And Cells(lngR,"A").Text <>"0131" Then
Rows(lngR).Copy Rows(Cells(Rows.Count,1).End(xlUp).Row+1)
Cells(lngR,"B").Value = "N"
Cells(lngR,"A").Value ="0131"
End If
Next lngR
End Sub
And this version will change the values before the row is copied
Sub TryMe3()
Dim lngR As Long
For lngR = 1 To Cells(Rows.Count,1).End(xlUp).Row
If Cells(lngR,"B").Value = "Y" And Cells(lngR,"A").Text <>"0131" Then
Cells(lngR,"B").Value = "N"
Cells(lngR,"A").Value ="0131"
Rows(lngR).Copy Rows(Cells(Rows.Count,1).End(xlUp).Row+1)
End If
Next lngR
End Sub
And this version will change the values in the row that was pasted at the bottom
Sub TryMe4()
Dim lngR As Long
Dim lngR2 As Long
For lngR = 1 To Cells(Rows.Count,1).End(xlUp).Row
If Cells(lngR,"B").Value = "Y" And Cells(lngR,"A").Text <>"0131" Then
lngR2 = Cells(Rows.Count,1).End(xlUp).Row+1
Rows(lngR).Copy Rows(lngR2)
Cells(lngR2,"B").Value = "N"
Cells(lngR2,"A").Value ="0131"
End If
Next lngR
End Sub