|
-
May 21st, 2000, 11:01 AM
#1
Thread Starter
Lively Member
try this
dim x as new excel.application
x = getobject(,"Excel.application")
x = getobject("c:\test.xls")
now try
x.application.sheets("Sheet1").select
x.application.row ..........
or else see Getobject example in vb help
Dim col as Varient, row as Integer
For col = A to Z
For row = 1 to 15
Xl.Range(col,row).Select
'get value and do stuff to it
Next row
Next col
I'm trying very hard but can't find any answers,Thanks in advance.
Joey O. [/B][/QUOTE]
-
May 21st, 2000, 01:38 PM
#2
Addicted Member
Ok here's the deal.
When pointing to a cell in a range in excel I usually don't use the "A1" notation but (rownumber, colnumer). So a code to loop through a column would look like:
Code:
Dim iCol as Integer, iRow as Integer
For iCol = 1 to 100 'or whatever number or columns
For iRow = 1 to 100 'or whatever number or rows
'This line prints values in cells in the active worksheet:
Debug.Print Cells(iRow,iCol).Value
'This line puts the row and column number in the cells:
Cells(iRow,iCol).Value = "'" & iRow & ";" & iCol
Next iRow
Next iCol
[Edited by pardede on 05-22-2000 at 08:41 AM]
-
May 21st, 2000, 11:25 PM
#3
Hyperactive Member
pardede,
Your awsome.Thanks, this code'll open up a lot of doors for me.
Thank You,
Joey O.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|