Adding a new row to a table when adding another row on another sheet

I have an Excel workbook in which I have several tables. On my 3 sheets there is some kind of "main" table, which is slightly different from each other.

These tables are 2 rows by default (1 header and 1 row of data) and expand when I add a new row below the existing one. Some fields use formulas that use values ​​from other tables. However, if, for example, I insert a new value in the field below the last row, adding another row to the table, I want the tables on other sheets to also add another row (and execute the formulas that are in the new row)

This is the sheet in which I have "Soorten Vezels" with their respective "max demping" and "soorten connectoren" with their corresponding "max demping" enter image description here

This is the maximum file. enter image description here

This is a measurement form, in this form the user does not need to enter anything except the 2 drop-down menus "type kabel" and "type connector" enter image description here

What I would like is that when the user, for example, enters the length ("lengte") in the file "maximale demping", a new line is added (the fields "kabelnr", "van" and "Naar" will be automatically populated from the file " gegevens ")

But I would also like the book to add a new line to the measurement form, it automatically fills the fields "kabelnr", "van" and "naar". So I need to select "type kabel" and "type connector" from the dropdown menu.

How to do it (with vba)?

+4
source share
1 answer

Personally, I like MSDN when I look for answers on VBA and vb.net. I believe that it was thorough and comprehensive. The more I learn, the more I understand what they are teaching on this site.

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

Getting started with VBA in Excel 2010

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

Also remember that during the transition you can perform a search in Stack Overflow, there are many questions that may be required at startup or ask more questions.

If you need more help, you can see the links below.

This link is helpful. But I would follow the links below to get a wider overview and find an explanation that will work for you.

Insert row in tables Multiple Excel 2010 sheets

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

Forum - this link leads to the question of inserting lines. MrExcel.com

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

If you continue, down the page, there is a good discussion with code examples and troubleshooting (you will get a popup when you click on this link to register in the newsletter, you can ignore it without any problems)

Insert row in tables Multiple Excel 2010 sheets

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

Useful Q & A from the Microsoft forum.

Insert empty rows into excel table with vba

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 freely ask new questions when you go.

+4
source

Source: https://habr.com/ru/post/1485604/


All Articles