hi,
Is it possible to count the number of "C"s that were placed?
The following code I have places a "C" in column 2 if there is a minus sign (-) in column 20 of the same row & and also delete the minus sign, beginning with row 14 through 23. After it reaches row 23, it performs an update (PF5) regardless if there were any minus signs found.(i didn't know how to bypass this, but that's not important).
After the update, it would page forward and continue until there are no entries in column 8.
I want to count the number of "C"s and place this number into Excel.I know how to place data into Excel.
Is it possible to count the number of "C"s that were placed?
The following code I have places a "C" in column 2 if there is a minus sign (-) in column 20 of the same row & and also delete the minus sign, beginning with row 14 through 23. After it reaches row 23, it performs an update (PF5) regardless if there were any minus signs found.(i didn't know how to bypass this, but that's not important).
After the update, it would page forward and continue until there are no entries in column 8.
I want to count the number of "C"s and place this number into Excel.I know how to place data into Excel.
Code:
Do
For X = 14 To 23
Minus = NY.Screen.GetString(X, 20, 1)
Pos = NY.Screen.GetString(X, 8, 6)
If Pos = " " Then
NY.Screen.SendKeys ("<PF5>") '<--Update
Exit Sub
End If
If Minus = "-" Then
NY.Screen.MoveTo X, 20
NY.Screen.SendKeys ("<Delete>")
NY.Screen.PutString "C", X, 2
End If
Next
NY.Screen.SendKeys ("<PF5>") '<--Update
NY.Screen.WaitHostQuiet (1000)
NY.Screen.SendKeys ("<PF2>") '<--Page forward
NY.Screen.WaitHostQuiet (1000)
Loop
End If
End Sub
[code]
thanks for your thoughts
zach