Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I move down one row in .getstring?

Status
Not open for further replies.

rellek01

Technical User
Aug 29, 2012
3
US
Hello -
I'm sure there is a very simple solution to this, but I have just not been able to figure it out.
Below is part of my code.
IDS1 =.getstring([highlight #FCE94F]8[/highlight],8,3)
If IDS1 = "IDS" Then
.putstring "S", [highlight #FCE94F]8[/highlight],4
.sendkeys ("<Enter>")
IDSIND = .getstring (7,24,1)
objExcel.WorkSheets("Sheet1").Cells(Row,3).Value = IDSIND
.sendkeys ("<PF3>")
GoTo NextRow
ElseIf .getstring([highlight #FCE94F]9[/highlight],8,3) = "IDS" Then
.putstring "S", [highlight #FCE94F]9[/highlight],4
.sendkeys ("<Enter>")
IDSIND = .getstring (7,24,1)
objExcel.WorkSheets("Sheet1").Cells(Row,3).Value = IDSIND
.sendkeys ("<PF3>")

Is there a way to simply add one to the row until the condition is met instead of creating an endless number of If/ElseIf statements?

Any guidance you may be able to provide would be most appreciated!!
 
hi,

Yes. Do your row processing in a loop.

Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
Thanks, Skip... could you possibly provide me with an example on how to loop my row processing?
 
Code:
For iRow = StartRow to EndRow
  IDS1 =.getstring(iRow,8, 3)
  If IDS1 = "IDS" Then .putstring "S", iRow, 4
Next

Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top