-
If I saved an Excel file in a similar grid format (columns & rows)- what programming code would I use to pull only the information I need based on the user inputting a specific column and row?
Any reply would be appreciated!
Thanks,
Stephen
[email protected]
[Edited by lspeed430 on 07-26-2000 at 06:11 PM]
-
Is your app acually looking at the excel file? If so you can use the data object or one of the other methods. I use DAO:
Dim data1 As Database
Dim rs As Recordset
Set data1 = OpenDatabase("c:\my documents\sample.xls", False, True, "excel 8.0;")
Set rs = data1.OpenRecordset(sheet1) 'picks a table from sample.xls called sheet1
Dim col, row, as integer
'get them from user
for j = 1 to row
rs.movenext
next row 'gets you to the row
textout= rs.fields(col)' assuming the top row of your excel is numbered 1 2 3 etc.
Humph
-
To retrieve data from a specific loaction, do
variable = myExcelWrk.Cells(r,c).Value
where myExcelWrk is an instance of an Excel worksheet,
r represents the row and,
c represents the column
-
Thanks J Hausman & Humph for your replies...
I really do appreciate this...
you guys are helping me get a programmer's job!!!!
I guess the same hints that you both gave me can go for a .csv file saved from an Excel database.
-
My approach reads Excel directly...