Hello,
I looking to write a macro that deletes certain rows on a sheet. I have just written a macro that inserts a row between entries for formatting purposes.
However on some occasions their is two accounts listed with the same Account number. When this happens i want to keep the two accounts but delete the blank line in the middle which was just inserted for formatting. Heres the code that inserts the formatting line;
'Insert Blank rows with colour between each line
Selection.End(xlDown).Select
Do Until ActiveCell.Row = 2
ActiveCell.EntireRow.Insert Shift:=xlDown
ActiveCell.RowHeight = 4.5
ActiveCell.Columns("A:N").Select
With Selection.Interior
.ColorIndex = 15
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
End With
'Move up one row.
ActiveCell.Offset(-1, 0).Select
Loop
So basically i need something that says if Line 1 and line 3 are equal. Delete row in between??
Thanks in advance
Eoin Walsh
I looking to write a macro that deletes certain rows on a sheet. I have just written a macro that inserts a row between entries for formatting purposes.
However on some occasions their is two accounts listed with the same Account number. When this happens i want to keep the two accounts but delete the blank line in the middle which was just inserted for formatting. Heres the code that inserts the formatting line;
'Insert Blank rows with colour between each line
Selection.End(xlDown).Select
Do Until ActiveCell.Row = 2
ActiveCell.EntireRow.Insert Shift:=xlDown
ActiveCell.RowHeight = 4.5
ActiveCell.Columns("A:N").Select
With Selection.Interior
.ColorIndex = 15
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
End With
'Move up one row.
ActiveCell.Offset(-1, 0).Select
Loop
So basically i need something that says if Line 1 and line 3 are equal. Delete row in between??
Thanks in advance
Eoin Walsh