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

How to detect OS version in System

/*
 * Os_version.c
 *
 *  Created on: 09.02.2015
 *  Author: Karthikeyan D
 *  This C code will be useful to detect the OS version in System...
 *  It can be adopted in in various application like Installation mode selection, Directory prediction, etc...
 *
 */

# include <stdio.h>
# include <stdlib.h>
int main()
{
    // To execute system command in  C program

    system("systeminfo | findstr /C:\"OS\"");

    printf("\n@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n");

    system(" systeminfo | findstr /B /C:\"OS Name\" /C:\"OS Version\"");

    printf("\n@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n");

    system("systeminfo");

    return 0;
}