Forum Discussion
Florian_Reitbauer3107
Aug 28, 2022Copper Contributor
Adding specific rows in Excel with VBA
Hello everyone,
I am trying to create a macro that adds specific rows in Excel/at a specific position. For visualization see screenshot below.
Basically what I´m trying to do is by clicking "button 3" I want Excel to add the rows 9-11 (see highlight in green-ish) as of line 13 with the same formatting plus the dropw-down field (highlighted in organge). Obviously, when clicking "button 3" again the three rows should be added as of row 17. The idea would be to have one row in between.
Thanks a lot in advance for your support - much appreciated.
2 Replies
Sort By
Sub Button3_Click() Dim r As Range Set r = Range("A" & Rows.Count).End(xlUp).Offset(2) Range("A9:J11").Copy Destination:=r Application.CutCopyMode = xlCopy End Sub
- Florian_Reitbauer3107Copper Contributor
HansVogelaar : fantastic - thanks a lot