Can anyone advise me on the following please.
I was just wondering if it was possible to loop through a tables data (cell by cell), much like you can do with an Excel worksheet in vba.
For example;
The reason I ask is that in one of my projects i create a separate spreadsheet (workbook), which the user can amend the data and then update the data in the database with the click of a button, for each job. But the headers (field names) in the sheets can be different for each job, so i can't reference the headers (field names) in an Access query.
I hope this makes sense, and you can follow it.
Thanks in advance.
I was just wondering if it was possible to loop through a tables data (cell by cell), much like you can do with an Excel worksheet in vba.
For example;
Code:
Dim objXL As Object
Set objXL = CreateObject("Excel.Application")
Do Until objXL.Cells(intRowCount, 1) = ""
'then read (and store) the data for the rest of the current row cells
strProduct = objXL.Cells(intRowCount, 1).Value
If objXL.Cells(intRowCount, 2).Value <> "" Then
strXLVal01 = objXL.Cells(intRowCount, 2).Value
End if
intRowCount = intRowCount + 1
Loop
I hope this makes sense, and you can follow it.
Thanks in advance.