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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Columns & Row Question

Status
Not open for further replies.

vzachin

Technical User
Feb 10, 2006
305
US
Hi,

I am scaping data into Excel.
Currently I have it set up as follows, where the data (Units)appears in 4 columns in Extra, beginning in Row 5 Col 2, ending with Row 23. I have the data scraped into Excel into 1 column (F1). This is easy because the data is the same.
Now I have a different screen with 2 columns of data (Units & Description), where the Unit appears in Row 5 Col 2,and the Description begins in Row 5 Col 20.
I need to scrape 2 columns into Excel. But I can't figure out how to write the code correctly.

This is what I have right now. Can anybody help me?



Do
For x = 5 To 23 'Rows.
For y = 2 To 61 Step 20 'Columns.

Unit = Sess0.Screen.getstring(x, y, 6)

Rw = Rw + 1 'Put Data in Excel
With Worksheets("EQPSC")
.Cells(Rw, "F").Value = Unit
End With

Next y
Next x

Sess0.Screen.SendKeys ("<Pf2>")

Loop

Next


Thanks,
zach
 



Hi,
Code:
For x = 5 To 23                     'Rows.
           
Unit = Sess0.Screen.getstring(x, 2, 2)  '2 characters?
Desc = Sess0.Screen.getstring(x, 20, 44)'44 characters?   
Rw = Rw + 1                          'Put Data in Excel
With Worksheets("EQPSC")
.Cells(Rw, "F").Value = Unit
.Cells(Rw, "G").Value = Desc

End With
          
Next x


Skip,

[glasses] [red][/red]
[tongue]
 
Hi Skip,

what a simple solution! Thanks




zach
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top