Showing posts with label Content traceability.... Show all posts
Showing posts with label Content traceability.... Show all posts

Monday, February 9, 2015

How to Compare one Column to other Column contents in Excel using VBA script.... Traceability...

Sub Traceability()

Dim i As Long
Dim j As Long
Dim k As Long
Dim CheckReq As String


i = 1
j = 1
 Sheets("Req").Select
 Do While Not IsEmpty(Sheets("Req").Cells(i, 1))
 Sheets("Req").Select
 CheckReq = RTrim(Sheets("Req").Cells(i, 1))
 Sheets("Req").Rows(i & ":" & i).Select
 Selection.Copy
 Sheets("Availability").Select
 Sheets("Availability").Rows(j & ":" & j).Select
 ActiveSheet.Paste

 k = 1
 Do While Not IsEmpty(Sheets("TestSpec").Cells(k, 1))

 If (RTrim(Sheets("TestSpec").Cells(k, 1)) = CheckReq) Then
 Sheets("Availability").Select
 Sheets("Availability").Cells(j, 13) = "Available in Test Spec"
 Exit Do
 End If
 k = k + 1

 Loop



 'This below variables for Req
 j = j + 1
 i = i + 1
   
 Loop
   
End Sub