访问Excel参数传递

时间:2013-08-12 18:24:07

标签: excel vba parameters access-vba

我有一个访问表,必须在excel中访问。我可以很容易地设置一个宏来转储整个表格并根据vba中的特定单元格进行过滤,但由于我有20,000条记录,因此会减慢工作表的速度。

是否有更快的传递参数的方式?

我尝试的方法是以前发布的答案之一

•in Excel go to the data ribbon and click the From other sources icon
•click From Microsoft Query
•select MS Access Database* 
•browse for and select your database. 
•in the wizard select the columns you need to import
•on the next page select the column you want to filter on
•select the type of filter you need, i.e. Equals
•instead of selecting a value in the next box enter [Parameter please Bob]
•enter you sort on the next page
•select Return data to Microsoft Excel and finish

但我不知道能不能将excel单元作为参数传递。我最终试图让它在vba中运行,但试图弄清楚这是如何工作的。

任何帮助都将不胜感激。

感谢Aprough,按照您的步骤操作,但无法选择参数字段

1 个答案:

答案 0 :(得分:1)

设置好所有内容后,右键单击返回数据中的任意位置,然后选择“参数”。选择左侧的参数,然后选择“从以下单元格中获取值:”,然后选择包含参数的单元格。每次刷新数据时,它都会使用该单元格作为参数值。这就是你“手动”的方式

相关问题