Related:
- Help using Excel Macro To Insert Rows
- Insert gif in excel - Guide
- Spell number in excel without macro - Guide
- How to insert photo in word for resume - Guide
- How to insert check mark in word - Guide
- How to insert watermark in word - Guide
2 responses
Apologies, having tried again I have figured out where I was going wrong! I hope I have not wasted anyones time!
If anyone is interestet at all, the macro is:
If ActiveCell.Value = ActiveCell.Offset(-1, 0).Value Then
ActiveCell.Offset(1, 0).Select
Else
Selection.Insert Shift:=xlDown
Selection.Insert Shift:=xlDown
Selection.End(xlDown).Select
ActiveCell.Offset(1, 0).Select
End If
End Sub
You can just hold down the macro shortcut and it will keep on going till it can go no more
Again, very sorry for wasting peoples time
If anyone is interestet at all, the macro is:
If ActiveCell.Value = ActiveCell.Offset(-1, 0).Value Then
ActiveCell.Offset(1, 0).Select
Else
Selection.Insert Shift:=xlDown
Selection.Insert Shift:=xlDown
Selection.End(xlDown).Select
ActiveCell.Offset(1, 0).Select
End If
End Sub
You can just hold down the macro shortcut and it will keep on going till it can go no more
Again, very sorry for wasting peoples time
Instead of holding down the shortcut key loop through the code. This method assumes when running the code there are no empty rows between data. Otherwise a for loop would work
sub Add_Spces()
Check:
if isempty(Activecell) or Activecell = 0 then Exit Sub
If ActiveCell.Value = ActiveCell.Offset(-1, 0).Value Then
ActiveCell.Offset(1, 0).Select
Else
Selection.Insert Shift:=xlDown
Selection.Insert Shift:=xlDown
Selection.End(xlDown).Select
ActiveCell.Offset(1, 0).Select
End If
goto: Check
End Sub
sub Add_Spces()
Check:
if isempty(Activecell) or Activecell = 0 then Exit Sub
If ActiveCell.Value = ActiveCell.Offset(-1, 0).Value Then
ActiveCell.Offset(1, 0).Select
Else
Selection.Insert Shift:=xlDown
Selection.Insert Shift:=xlDown
Selection.End(xlDown).Select
ActiveCell.Offset(1, 0).Select
End If
goto: Check
End Sub