| |
ploosie
Posts: 45
Score: 0
Joined: 3/2/2008
Status: offline
|
Here is a compare script that I use all the time to compare 2 columns in Excel. Just modify the script to suit your needs. Set objExcel = CreateObject("Excel.Application") objExcel.Visible = True Set objWorkbook = objExcel.Workbooks.Open("C:\YourExcelFile.xls") Set objWorksheet = objWorkbook.Worksheets(1) Set objRange = objWorksheet.Range("B1").EntireColumn i = 1 Do Until objExcel.Cells(i, 1).Value = "" strName = objExcel.Cells(i, 1).Value Set objSearch = objRange.Find(strName) If objSearch Is Nothing Then Wscript.Echo strName & " MISSING!!" Else Wscript.Echo strName & "Found" End If i = i + 1 Loop Set objRange = objWorksheet.Range("A1").EntireColumn i = 1 Do Until objExcel.Cells(i, 2).Value = "" strName = objExcel.Cells(i, 2).Value Set objSearch = objRange.Find(strName) If objSearch Is Nothing Then Wscript.Echo strName & " MISSING!!" Else Wscript.Echo strName & "Found" End If i = i + 1 Loop Msgbox "Done"
|
|