Help, please
I have code that I am trying to workout that will pull a match from two worksheets, then confirm in one of these that a value is found and then add data to a third sheet in the same workbook.
It is not working and the latest attempt is below.
Any ideas?
DThib
I have code that I am trying to workout that will pull a match from two worksheets, then confirm in one of these that a value is found and then add data to a third sheet in the same workbook.
It is not working and the latest attempt is below.
Any ideas?
DThib
Code:
Sub DataRun()
'Dim MBs, Coos, QAs As Worksheets
Dim MBRow, CoRow, QARow As Long
Dim i, j, k As Long
'MBs = Sheets("MB51_Draw")
'Coos = Sheets("COOIS_Draw")
'QAws = Sheets("QA_Data")
MBRow = Sheets("MB51_Draw").Cells(Rows.Count, "A").End(xlUp).Row
CoRow = Sheets("COOIS_Draw").Cells(Rows.Count, "A").End(xlUp).Row
QARow = Sheets("QA_Data").Cells(Rows.Count, "A").End(xlUp).Row
i = 1 + MBRow
j = 1 + QARow
k = CoRow
For k = 1 To CoRow
If Sheets("COOIS_Draw").Cells(k, 1).Value = Sheets("MB51_Draw").Cells(i, 1).Value And _
Sheets("MB51_Draw").Cells(i, 7).Value = "543" Then
Sheets("QA_Data").Cells(j, 1).Value = Sheets("COOIS_Draw").Cells(k, 4).Value
End If
Next
End Sub
Last edited: