简体   繁体   English

如何使用VBA将Excel 2016数据导出到另一个电子表格中?

[英]How do I export Excel 2016 data into another spreadsheet using VBA?

I am attempting to send multiple users an Excel spreadsheet containing a form that collects data. 我正在尝试向多个用户发送包含表格的Excel电子表格,该表格可以收集数据。 I would like to append their input data to the bottom row of common file. 我想将他们的输入数据附加到公共文件的底部。 Is there a way for each of these users to be able to "submit" their input data, which I've collected in the form of a table, and export to a separate spreadsheet? 这些用户中的每个用户是否可以“提交”他们以表的形式收集的输入数据,然后导出到单独的电子表格中?

You can use the following objects to send your collection spreadsheet to multiple users. 您可以使用以下对象将您的集合电子表格发送给多个用户。

' Outlook variables
Dim oOlAp As Object, oOlns As Outlook.Namespace, oOlInb As Object, oOlInb1 As Object
Dim oOlItm As Object, oOlAtch As Object

' Get Outlook instance
Set oOlAp = GetObject(, "Outlook.application")
Set oOlns = oOlAp.GetNamespace("MAPI")

In that spreadsheet, use the same objects to send the answer table back to you. 在该电子表格中,使用相同的对象将答案表发回给您。

Then in a "upload" spreadsheet that runs on your computer, use those same objects to extract all said tables from the answer emails. 然后,在计算机上运行的“上传”电子表格中,使用这些相同的对象从应答电子邮件中提取所有所述表格。

After that you can use the normal excel interface to populate your access database. 之后,您可以使用普通的excel界面来填充您的访问数据库。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM