Hello guys,
I currently have data inputted into a cell range from B7:I48 and I have a macro that when selected or executed will make a new row on line 49. If this button is selected again, it will add a row on 49 instead of at the end of the new dataset line 50. As the dataset expands down, I would like the macro to insert a row on the line right after the data set. My current code is as follows below. Please advise on how this code should be adjusted. Thank you very much.
![]()
Sub Insert_Row() ' ' Insert_Row Macro ' ' ActiveWindow.SmallScroll Down:=30 Rows("49:49").Select Selection.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove Range("B48:C48").Select Selection.AutoFill Destination:=Range("B48:C49"), Type:=xlFillDefault Range("B48:C49").Select Range("B49").Select ActiveWindow.SmallScroll Down:=-42 End Sub
Bookmarks