marreco
08-26-2012, 08:47 AM
Hi.
I need to insert empty rows based on a criteria in cell 'A1'
example
is' A1 'is equal to 3 then will be inserted between the range three lines "A2: G10'
I tried this but not working:(
Sub Insert_Blank_Rows()
'Select last row in worksheet.
Selection.End(xlDown).Select
Do Until ActiveCell.Row = Range("A1").Value
'Insert blank row.
ActiveCell.EntireRow.insert shift:=xlDown
'Move up one row.
ActiveCell.Offset(-1, 0).Select
Loop
End Sub
I need to insert empty rows based on a criteria in cell 'A1'
example
is' A1 'is equal to 3 then will be inserted between the range three lines "A2: G10'
I tried this but not working:(
Sub Insert_Blank_Rows()
'Select last row in worksheet.
Selection.End(xlDown).Select
Do Until ActiveCell.Row = Range("A1").Value
'Insert blank row.
ActiveCell.EntireRow.insert shift:=xlDown
'Move up one row.
ActiveCell.Offset(-1, 0).Select
Loop
End Sub