在不同的表中添加另一行时,向表添加新行

时间:2022-09-15 21:21:19

I have an excel workbook in wich i have several tables. On 3 of my sheets, there is some kind of "main" table wich differ a bit from one another.

我有一个excel工作簿在我有几个表。在我的三张被单上,有一些不同的“主”桌子。

These tables are 2 lines by default (1 header and 1 data row) and extend when I add a new line below the one already existing. In some of the fields are formulas wich are using values from the other tables. However, if for example, I insert a new value in a field below the final row, thus adding another row to the table, I want the tables in the other sheets to also add another row (and execute the formulas that are in the new row)

这些表默认是2行(1个头和1个数据行),当我在已有的表下面添加新行时,这些表会扩展。在一些字段中,有些公式使用了其他表中的值。但是,如果例如,我在最后一行下面的字段中插入一个新值,从而向表中添加另一行,我希望其他表中的表也添加另一行(并执行新行中的公式)

This is the sheet in wich i have "Soorten Vezels" with their corresponding "max demping" and "soorten connectoren" with their corresponding "max demping" 在不同的表中添加另一行时,向表添加新行

这是威奇的表格我有"Soorten Vezels"和对应的"max demping"和"Soorten connectoren"还有对应的"max demping"

This is the "maximale demping" file 在不同的表中添加另一行时,向表添加新行

这是“最大需求”文件

This is the measurement form, in this form, the user should not have to enter anything, except for the 2 dropdown menu's "type kabel" and "type connector" 在不同的表中添加另一行时,向表添加新行

这是测量表单,在这个表单中,用户不需要输入任何东西,除了2下拉菜单中的“type kabel”和“type connector”

What I would like is that when the user for example, inputs the lenght ("lengte") in the "maximale demping" file, a new row gets added (the fields "kabelnr" , "van" and "naar" will be filled in automatically from the "gegevens" file)

我想要的是,当用户在“maximale demping”文件中输入lenght(“lengte”)时,将添加一个新的行(字段“kabelnr”、“van”和“naar”将从“gegevens”文件中自动填充)

But I would also like the workbook to add a new line in the measurement form, automatically fills in the "kabelnr" , "van" and "naar" fields. So that I only have to choose the "type kabel" and " type connector" from the dropdown menu.

但是我也希望在测量表单中添加一个新的行,自动填充“kabelnr”、“van”和“naar”字段。因此,我只需从下拉菜单中选择“type kabel”和“type connector”。

How do I do this (with vba)?

我怎么做(用vba)?

1 个解决方案

#1


4  

Personally I like the MSDN when I am looking for answers to VBA and vb.net. I have found it to be thorough and comprehensive. The more I learn, the more I understand what they are teaching on this site.

就我个人而言,当我在寻找VBA和vb.net的答案时,我喜欢MSDN。我发现它是全面而彻底的。我学得越多,就越明白他们在这个网站上教的是什么。

This is a good tutorial to get started. Follow the links from this page.

这是一个很好的入门教程。跟随本页的链接。

Getting Started with VBA in Excel 2010

在Excel 2010中开始使用VBA

http://msdn.microsoft.com/en-us/library/office/ee814737(v=office.14).aspx

http://msdn.microsoft.com/en-us/library/office/ee814737(v = office.14). aspx

Also remember to search Stack Overflow as you progress, there are an amazing number of questions covering specifics you may require when you start, or ask more questions.

还要记住,当您进行搜索时,会有大量的问题涉及您在开始时可能需要的细节,或者询问更多的问题。

If you require further assistance you can look at the links below.

如果您需要进一步的帮助,可以查看下面的链接。

This link is helpful. But I would navigate through the links below to get a broader view and to find an explanation that works for you.

这个链接是有益的。但我会浏览下面的链接,以获得更广泛的视角,并找到一个适合你的解释。

Insert Row in Tables Multiple Sheets Excel 2010

在多个Excel 2010表格中插入行

http://chandoo.org/forums/topic/insert-row-in-tables-multiple-sheets-excel-2010

http://chandoo.org/forums/topic/insert -行-表-多-表- excel - 2010

A forum- this link leads to a question about inserting rows. MrExcel.com

一个论坛-这个链接导致一个关于插入行的问题。MrExcel.com

http://www.mrexcel.com/forum/excel-questions/58685-insert-rows-between-different-data-2-a.html

http://www.mrexcel.com/forum/excel-questions/58685-insert-rows-between-different-data-2-a.html

If you persevere, down the page, there is good discussion, with code examples and trouble shooting (you will get a pop up when you go to this link asking to sign up for the newsletter, you can disregard this without a problem)

如果你坚持下去,在这一页下面,有很好的讨论,有代码示例和问题解决(当你去这个链接请求注册时事通讯时,你会得到一个弹出窗口,你可以毫不费力地忽略这一点)

Insert Row in Tables Multiple Sheets Excel 2010

在多个Excel 2010表格中插入行

http://chandoo.org/forums/topic/insert-row-in-tables-multiple-sheets-excel-2010

http://chandoo.org/forums/topic/insert -行-表-多-表- excel - 2010

A useful Q&A from Microsoft forum.

来自微软论坛的一个有用的问答。

Insert blank rows in excel table with vba

使用vba在excel表中插入空行

http://answers.microsoft.com/en-us/office/forum/office_2007-customize/insert-blank-rows-in-excel-table-with-vba/69e369a8-e656-4f68-adcd-c57e37253f12

http://answers.microsoft.com/en-us/office/forum/office_2007-customize/insert-blank-rows-in-excel-table-with-vba/69e369a8-e656-4f68-adcd-c57e37253f12

Please let me know if this helps and ask new questions freely as you go.

如果这对你有帮助,请告诉我,并问一些新的问题。

#1


4  

Personally I like the MSDN when I am looking for answers to VBA and vb.net. I have found it to be thorough and comprehensive. The more I learn, the more I understand what they are teaching on this site.

就我个人而言,当我在寻找VBA和vb.net的答案时,我喜欢MSDN。我发现它是全面而彻底的。我学得越多,就越明白他们在这个网站上教的是什么。

This is a good tutorial to get started. Follow the links from this page.

这是一个很好的入门教程。跟随本页的链接。

Getting Started with VBA in Excel 2010

在Excel 2010中开始使用VBA

http://msdn.microsoft.com/en-us/library/office/ee814737(v=office.14).aspx

http://msdn.microsoft.com/en-us/library/office/ee814737(v = office.14). aspx

Also remember to search Stack Overflow as you progress, there are an amazing number of questions covering specifics you may require when you start, or ask more questions.

还要记住,当您进行搜索时,会有大量的问题涉及您在开始时可能需要的细节,或者询问更多的问题。

If you require further assistance you can look at the links below.

如果您需要进一步的帮助,可以查看下面的链接。

This link is helpful. But I would navigate through the links below to get a broader view and to find an explanation that works for you.

这个链接是有益的。但我会浏览下面的链接,以获得更广泛的视角,并找到一个适合你的解释。

Insert Row in Tables Multiple Sheets Excel 2010

在多个Excel 2010表格中插入行

http://chandoo.org/forums/topic/insert-row-in-tables-multiple-sheets-excel-2010

http://chandoo.org/forums/topic/insert -行-表-多-表- excel - 2010

A forum- this link leads to a question about inserting rows. MrExcel.com

一个论坛-这个链接导致一个关于插入行的问题。MrExcel.com

http://www.mrexcel.com/forum/excel-questions/58685-insert-rows-between-different-data-2-a.html

http://www.mrexcel.com/forum/excel-questions/58685-insert-rows-between-different-data-2-a.html

If you persevere, down the page, there is good discussion, with code examples and trouble shooting (you will get a pop up when you go to this link asking to sign up for the newsletter, you can disregard this without a problem)

如果你坚持下去,在这一页下面,有很好的讨论,有代码示例和问题解决(当你去这个链接请求注册时事通讯时,你会得到一个弹出窗口,你可以毫不费力地忽略这一点)

Insert Row in Tables Multiple Sheets Excel 2010

在多个Excel 2010表格中插入行

http://chandoo.org/forums/topic/insert-row-in-tables-multiple-sheets-excel-2010

http://chandoo.org/forums/topic/insert -行-表-多-表- excel - 2010

A useful Q&A from Microsoft forum.

来自微软论坛的一个有用的问答。

Insert blank rows in excel table with vba

使用vba在excel表中插入空行

http://answers.microsoft.com/en-us/office/forum/office_2007-customize/insert-blank-rows-in-excel-table-with-vba/69e369a8-e656-4f68-adcd-c57e37253f12

http://answers.microsoft.com/en-us/office/forum/office_2007-customize/insert-blank-rows-in-excel-table-with-vba/69e369a8-e656-4f68-adcd-c57e37253f12

Please let me know if this helps and ask new questions freely as you go.

如果这对你有帮助,请告诉我,并问一些新的问题。