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

4 comments:

  1. This program easy to understand for me.thank you so much for sharing.

    ReplyDelete
  2. Magnificent post offer with us and this web diary is wonderments more people to examining that blog.
    Slap shot drinking game Mexico

    ReplyDelete
  3. thank you for your post.hawkscode is one of the best IOS development company

    ReplyDelete