|
-
Jul 26th, 2000, 04:54 PM
#1
Thread Starter
New Member
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]
-
Jul 26th, 2000, 07:25 PM
#2
New Member
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
-
Jul 26th, 2000, 07:27 PM
#3
Frenzied Member
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
-
Jul 27th, 2000, 12:10 AM
#4
Thread Starter
New Member
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.
-
Jul 27th, 2000, 10:28 AM
#5
Frenzied Member
My approach reads Excel directly...
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
|