Hi,
I have a spreadsheet that has two bits of information that always appear in columns A and B but the row can vary.
Basically I want to loop through the file until the contents of A<i>n</i>='Total Ed Mozley' and then display the contents of B<i>n</i>.
So far I've got the following but have no idea if I'm even on the right track! Any help much appreciated.
<%
Dim oWorkbook As Excel.Workbook
Dim oWorksheet As Excel.Worksheet
Set oWorkbook = oExcelApp.Workbooks.Open(dataPath)
Set oWorksheet = oExcelApp.Worksheets("MyWorksheet")
For i=1 to rowCount
If (oWorksheet.Cells.Item(i, 1).Value)="Total Ed Mozley" Then
Response.Write(oWorksheet.Cells.Item(i, 2).Value)
End If
Next
Set oWorksheet = Nothing
Set oWorkbook = Nothing
Set oExcelApp = Nothing
%>
I have a spreadsheet that has two bits of information that always appear in columns A and B but the row can vary.
Basically I want to loop through the file until the contents of A<i>n</i>='Total Ed Mozley' and then display the contents of B<i>n</i>.
So far I've got the following but have no idea if I'm even on the right track! Any help much appreciated.
<%
Dim oWorkbook As Excel.Workbook
Dim oWorksheet As Excel.Worksheet
Set oWorkbook = oExcelApp.Workbooks.Open(dataPath)
Set oWorksheet = oExcelApp.Worksheets("MyWorksheet")
For i=1 to rowCount
If (oWorksheet.Cells.Item(i, 1).Value)="Total Ed Mozley" Then
Response.Write(oWorksheet.Cells.Item(i, 2).Value)
End If
Next
Set oWorksheet = Nothing
Set oWorkbook = Nothing
Set oExcelApp = Nothing
%>