I have a workbook with two worksheets on it. Worksheet "Sheet2" has the new months data and worksheet "Audit scores" is the sheet that I am copying the data to. The code I wrote is suppose to check for the equipment name in "Sheet2" Column c and find the matching one in "Audit scores" then copy the value from the Sheet2 column e and paste it into the last column in the appropriate row on Audit scores. The issue that I'm having is that the value being pasted in "Audit scores" is not the correct value from "Sheet2". Hopefully the mistake is a simple one and i'm just blind to it.
Here's the code:
Sub newdata()
Dim x As Variant, y As Long, z As Long, v As Date
LRow = Cells(Rows.Count, 2).End(xlUp).Row
Lcol = Cells(3, Columns.Count).End(xlToLeft).Column
v = Date
Worksheets("Audit scores").Activate
Cells(1, Lcol + 1).EntireColumn.Insert
Cells(1, Lcol + 1).Value = v
For y = 1 To LRow
For z = 1 To LRow
If Cells(z, "C").Value = Worksheets("Audit scores").Cells(y, "C").Value Then
Worksheets("Sheet2").Cells(z, "E").Copy Destination:=Worksheets("Audit scores").Cells(y, Lcol + 1)
Else:
End If
Next z
Next y
End Sub
Thanks for any help you can give me.