This is the Do While to Loop part (which is most of the script)
Do While objSheet.Cells(intRow, 1).Value <> ""
strSearch = objSheet.Cells(intRow, 3).Value
'Get the local Computer Name
strServerName = WScript.CreateObject("WScript.Network"

.ComputerName
'Get the Default Domain Naming Context
strDefaultDomainNC = GetObject("LDAP://RootDSE"

.Get("DefaultNamingContext"
If (IsEmpty(strDefaultDomainNC)) Then
' Wscript.Echo(""

Wscript.Echo("Error: Did not get the Default Naming Context"

Call Cleanup(2)
End If
'Set up the ADO connection required to implement the search.
Set objADOConn = CreateObject("ADODB.Connection"
objADOConn.Provider = "ADsDSOObject"
'Connect using current user credentials
objADOConn.Open "Active Directory Provider"
Set objADOCommand = CreateObject("ADODB.Command"

Set objADOCommand.ActiveConnection = objADOConn
'Format search criteria using SQL syntax
strADSQuery = "SELECT samAccountName, givenName, sn, AdsPath FROM 'LDAP:// " & _
strDefaultDomainNC & "' WHERE samAccountName = '" & strSearch & "'"
objADOCommand.CommandText = strADSQuery
'Execute the search
Set objQueryResultSet = objADOCommand.Execute
If (objQueryResultSet.EOF) Then
' Wscript.Echo(""

objTextFile.WriteLine ("User " & strSearch & " was not found"

objTextFile.WriteBlankLines(1)
Call Cleanup(4)
End If
intCount = 0
While Not objQueryResultSet.EOF
strAdsPath = objQueryResultSet.Fields("AdsPath"

intCount = intCount + 1
objQueryResultSet.MoveNext
Wend
objADOConn.Close
' Search for object
Set objConnection = CreateObject("ADODB.Connection"

objConnection.Open "Provider=ADsDSOObject;"
Set objCommand = CreateObject("ADODB.Command"

objCommand.ActiveConnection = objConnection
' Search string
objCommand.CommandText = _
"<LDAP://OU=Staging,dc=test,dc=local>;(objectCategory=user)" & _
";distinguishedName,name;subtree"
Set objRecordSet = objCommand.Execute
' If no errors search for user
If Err.Number = 0 then
While Not objRecordSet.EOF
if objRecordSet.Fields("Name"

= strSearch then
boolResult = True
End if
objRecordSet.MoveNext
Wend
End if
objConnection.Close
'If a single user was returned, demonstrate binding to the user object
If intCount = 1 Then
Set objUser = GetObject(strAdsPath)
If boolResult = false Then
objTextFile.WriteLine ("sAMAccountName: " & objUser.Get("sAMAccountName"

)
objTextFile.WriteLine ("The AdsPath is: " & objQueryResultSet.Fields("AdsPath"

)
objTextFile.WriteLine Now
objTextFile.WriteBlankLines(1)
Else
objTextFile.WriteLine ("Non Anomalous user"

End If
End If
Set objUser = Nothing
intRow = intRow + 1
Loop
Be gentle

but thanks for replies already mate