Adding Variable Number of Rows

  • Hi, I'm new to VBA and have done a basics course getting me to the point of creating forms. However, I'm working on a new project where I am trying to write a macro to create a table. So far I have managed to convert a set range to a table, but now I need to add some rows. The number of rows will vary each time I use the sheet: the variant number is in cell F5; so if the value in F5 is 10, then I will need to add 10 rows to the table. The table is named "NewTable" when it is created and this is what I have so far:




    My question is what do I need to do to add the number of rows as specified in F5 please?


    Thank you.

  • Code Tags Added
    Your post does not comply with our Forum RULES. Use code tags around code.


    Posting code between

    Code

    tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.


    Highlight your code and click the # icon at the top of your post window.


    (I have added them for you today. Please take a few minutes to read all Forum Rules and comply in the future.)

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!