Hi have code to add new row. When I click the button, the code will run to add new row based on what I set from coding. Now, what I want is when I click the button, row from Sheet 1 & row from Sheet 2 will be added together. I placed the button at Sheet 1.
What item I need to add so that the button that I placed in Sheet 1 work for both Sheet 1 & Sheet 2 automatic. Example, if I add 3 new row, Sheet 1 & Sheet 2 will add new 3 row as well.
This is my code.
Sub RectangleRoundedCorners7_Click()
Dim tmpStr As String, howMany As Integer
Dim i As Long
tmpStr = InputBox("How many row do you want to add? {Reminder: not to add row if lowest cell still blank}")
If Len(tmpStr) = 0 Then
howMany = 0
Else
howMany = CInt(tmpStr)
End If
With Range("B7").End(xlDown).EntireRow
For i = 1 To howMany
.Copy
.Offset(1).Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
.Offset(1).SpecialCells(xlCellTypeConstants).Value = ""
Application.CutCopyMode = False
On Error GoTo 0
Next
End With
End Sub
Thank You.