Hi all
i have this below macro that inserts a line when there is a change in a certain column
i would like for another input box to ask me how many lines i want to add and based on what i enter in that input box it will create the number of blank lines that i need
i don't always want to change this code "Rows(lRow).EntireRow.Insert"
Sub InsertRowAtChangeInValue()
Dim BB As String
Dim lRow As Long
BB = Application.InputBox(Prompt:="Enter the cell address")
For lRow = Cells(Cells.Rows.Count, BB).End(xlUp).Row To 2 Step -1
If Cells(lRow, BB) <> Cells(lRow - 1, BB) Then
Rows(lRow).EntireRow.Insert
Rows(lRow).EntireRow.Insert
End If
Next lRow
End Sub
i have this below macro that inserts a line when there is a change in a certain column
i would like for another input box to ask me how many lines i want to add and based on what i enter in that input box it will create the number of blank lines that i need
i don't always want to change this code "Rows(lRow).EntireRow.Insert"
Sub InsertRowAtChangeInValue()
Dim BB As String
Dim lRow As Long
BB = Application.InputBox(Prompt:="Enter the cell address")
For lRow = Cells(Cells.Rows.Count, BB).End(xlUp).Row To 2 Step -1
If Cells(lRow, BB) <> Cells(lRow - 1, BB) Then
Rows(lRow).EntireRow.Insert
Rows(lRow).EntireRow.Insert
End If
Next lRow
End Sub