Hello,
I am creating a worksheet that has a Dropdown list with values in Column B, and depending on the value the user selects it will call the macro below to insert a user defined number of rows below their selection. I then want the macro to populates specific text in Columns A, B, and I for every row created. The other cells can remain blank as they are now.
If user inputs to create 10 rows, then 10 rows are created with each row containing the following text:
Column A: "Sub Line"
Column B: "Internal Component"
Column I: "N/A"
I feel like this shouldn't be complicated but am still learning and reading up on VBA and the whole custom number of rows is throwing me off. Would be much appreciated if someone can point me in the right direction. Thank you!
I am creating a worksheet that has a Dropdown list with values in Column B, and depending on the value the user selects it will call the macro below to insert a user defined number of rows below their selection. I then want the macro to populates specific text in Columns A, B, and I for every row created. The other cells can remain blank as they are now.
If user inputs to create 10 rows, then 10 rows are created with each row containing the following text:
Column A: "Sub Line"
Column B: "Internal Component"
Column I: "N/A"
I feel like this shouldn't be complicated but am still learning and reading up on VBA and the whole custom number of rows is throwing me off. Would be much appreciated if someone can point me in the right direction. Thank you!
Code:
Sub CustomRow()
Dim X As Integer
x = Application.InputBox("How many rows?", "How many rows", Type:=1)
If x = False Then Exit Sub
Range(ActiveCell.Offset(1), ActiveCell.Offset(x)).EntireRow.Insert Shift:=xlDown
End Sub
Dim x