I am trying to transfer data from several spreadsheets in a workbook to different Access tables (in the same database).
Here's a snippet:
' open a recordset
Set rs = New ADODB.Recordset
rs.Open "c:\Data\Co_A_Datafiles\Spreadsheet1.xls", cn, adOpenKeyset, adLockOptimistic, adCmdTable
' all records in a table
r = 2 ' the start row in the worksheet
Do While Len(Range("A" & r).Formula) > 0
1. I don't know what the syntax is for opening a worksheet within a workbook (Say, WorkbookA; Spreadsheet1)
and,
2. I would like to use the value from a cell (say D15) in the CodeWorkbook to reference the spreadsheet that is to open. I would include a concatenation to include the static path and the dynamic workbook and spreadsheet names.
Thanks.
swt
Here's a snippet:
' open a recordset
Set rs = New ADODB.Recordset
rs.Open "c:\Data\Co_A_Datafiles\Spreadsheet1.xls", cn, adOpenKeyset, adLockOptimistic, adCmdTable
' all records in a table
r = 2 ' the start row in the worksheet
Do While Len(Range("A" & r).Formula) > 0
1. I don't know what the syntax is for opening a worksheet within a workbook (Say, WorkbookA; Spreadsheet1)
and,
2. I would like to use the value from a cell (say D15) in the CodeWorkbook to reference the spreadsheet that is to open. I would include a concatenation to include the static path and the dynamic workbook and spreadsheet names.
Thanks.
swt