Hi All
I have the following script below as part of a bigger script.
It basically collects ports up and down on cisco switches and then puts the stats into Excel. That all works fine but i need to read all of column C1 and count the 2's (down)and provide the total amount with an echo.
Can anyone help as the code i have here just tells me the value of the cell each time?
Set objRange = objExcel.Range("C1").EntireColumn
i = 1
Do Until objExcel.Cells(i, 3).Value = ""
strName = objExcel.Cells(i, 3).Value
Set objSearch = objRange.Find(strName)
If objSearch Is Nothing Then
Wscript.Echo strName & " was not found."
Else
Wscript.Echo strName & " was found."
End If
i = i + 1
Loop
I have the following script below as part of a bigger script.
It basically collects ports up and down on cisco switches and then puts the stats into Excel. That all works fine but i need to read all of column C1 and count the 2's (down)and provide the total amount with an echo.
Can anyone help as the code i have here just tells me the value of the cell each time?
Set objRange = objExcel.Range("C1").EntireColumn
i = 1
Do Until objExcel.Cells(i, 3).Value = ""
strName = objExcel.Cells(i, 3).Value
Set objSearch = objRange.Find(strName)
If objSearch Is Nothing Then
Wscript.Echo strName & " was not found."
Else
Wscript.Echo strName & " was found."
End If
i = i + 1
Loop