一部のデータを含む Excel ファイルがあり、VBA を使用してすべてのデータを MS Access にインポートし、クエリを実行して、最終的にデータをレポートに表示する必要があります。これはどのように達成できますか?
3517 次
2 に答える
2
Microsoft Excel データがリスト形式であることを確認してください。各列の最初の行にラベルがあり、同様の事実が含まれており、リスト内に空白の行または列がありません。
Close the Excel workbook that contains the data you want to use in Microsoft Access.
In Access, open the database where you want to copy the Excel data.
On the Access File menu, point to Get External Data, and then click Import.
In the Import dialog box, click Microsoft Excel in the Files of type box.
In the Look in list, locate the file you want to import, and then double-click the file.
Follow the directions in the Import Spreadsheet Wizard.
ありがとう
于 2012-11-19T09:52:22.713 に答える
0
次のように docmd.transterspreadsheet を使用します。
DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel12Xml,tblName, impPath, False, impSheet
where tblName is table to add data to
impPath is path and file name of excel workbook to import from
false = no field names in import area (true =field name included in import area)
sheet = sheet name and range ie "sheet!b5:j15"
于 2012-11-17T06:57:34.967 に答える