yn19832
03-08-2007, 09:31 AM
I want to transfer an excel spreadsheet to Access, which contains 9 sheets.I can not directly import the excel data, as I need to dispaly data with different forms in Access. I have almost done all the codes with VBA, the problem now is I want to creat a loop to call a function dealing with different sheets in the Excel.
My codes are as following:
Sub UpdateIndexes()
Dim rec As DAO.Recordset, inad1 As Address, i As Integer,
Set db = CurrentDb
Set rec = db.OpenRecordset("tblIndex")
inad1.Wbook = "\\c\file\*.xls"
Excel.Workbooks.Open inad1.Wbook, False, True
With ActiveWorkbook
I do not know about this part. The excel contains 9 sheets, for each
sheet, I want to call a function I have already defined . I do not know how to call that function within each sheet.
End With
End Sub
I would be grateful if anyone can help me sort it out.
My codes are as following:
Sub UpdateIndexes()
Dim rec As DAO.Recordset, inad1 As Address, i As Integer,
Set db = CurrentDb
Set rec = db.OpenRecordset("tblIndex")
inad1.Wbook = "\\c\file\*.xls"
Excel.Workbooks.Open inad1.Wbook, False, True
With ActiveWorkbook
I do not know about this part. The excel contains 9 sheets, for each
sheet, I want to call a function I have already defined . I do not know how to call that function within each sheet.
End With
End Sub
I would be grateful if anyone can help me sort it out.