【发布时间】:2012-06-12 15:06:27
【问题描述】:
我正在尝试在 Microsoft Access 中编写一个 VBA 脚本,该脚本将与 Excel 工作表交互,循环遍历行和行中的单元格,然后将信息拉回 Access 表中。
这是一些 sudo 代码-
For Each Row
For Each Cell in the Row
Read the Cell
Create a new Record in the Access table with the info from the cell
End For Each
End For Each
您可以在下面的图片中看到最终结果的简化示例。
我们有什么-
需要什么-
我以前编写过代码,但从未在 VBA 中编写过代码;所以任何帮助将不胜感激!谢谢你的帮助!!!
【问题讨论】:
-
请阅读Remou wrote,已经有一个内置的方法可以做到这一点。即使将范围读入数组而不是循环遍历每个单元格也会更好。