I am trying to insert a button with macros to insert a row below a particular row each time this button is clicked. I took some help and put below code, not working out, can some one help
Sub InsertRowHere()
Selection.EntireRow.Insert
i = ActiveCell.Row
Rows(i - 5 & ":" & i - 5).EntireRow.Copy Cells(i, "A")
End Sub
ActiveWorkbook.Save
ActiveSheet.Shapes("Button 1").Select
Selection.OnAction = "InsertRowHere"
ActiveSheet.Shapes("Button 1").Select
Selection.Characters.Text = "INSERT"
With Selection.Characters(Start:=1, Length:=6).Font
.Name = "Arial"
.FontStyle = "Regular"
.Size = 10
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
End With
Range("E11").Select
Application.Run "'TEST BOOK.xls'!InsertRowHere
Sub InsertRowHere()
Selection.EntireRow.Insert
i = ActiveCell.Row
Rows(i - 5 & ":" & i - 5).EntireRow.Copy Cells(i, "A")
End Sub
ActiveWorkbook.Save
ActiveSheet.Shapes("Button 1").Select
Selection.OnAction = "InsertRowHere"
ActiveSheet.Shapes("Button 1").Select
Selection.Characters.Text = "INSERT"
With Selection.Characters(Start:=1, Length:=6).Font
.Name = "Arial"
.FontStyle = "Regular"
.Size = 10
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
End With
Range("E11").Select
Application.Run "'TEST BOOK.xls'!InsertRowHere