macros for excel 2016

Hi,

Im having a macro for adding a new module into the excel. Aim is to insert this newly added module to a row inside a table but which is not at the end row of the table. So how i can i add a new row anywhere inside a table in excel.

Top Contributor Asked on December 7, 2017 in VBA: Programming.
Add Comment
1 Answer(s)

This will add a row anywhere in a table. You will need to know what the table number  of the table that you are using is and place it in the code.

RE: macros for excel 2016

[Code]

Sub insertrow()
Dim r As Long
r = InputBox(“Add a new row below row?”, “Add Row”)
ActiveSheet.ListObjects(“Table1”).ListRows.Add (r)
End Sub

Expert Answered on January 27, 2018.
Add Comment
  • Found this useful?

    Please share using the share button above.

    If you found the answer is best answer for your question, Please mark as 'best answer' by clicking on the right tick mark icon at the left side of the answer.

    Found the answer useful and wants to credit the user, then vote the answer (vote up).

  • Your Answer

    By posting your answer, you agree to the privacy policy and terms of service.