Good afternoon,
I'm not too advanced in excel. I developed a form that other people to complete. I need to have an option for them to add a line that will automatically format the same as the line above or below it, including some cells being merged and others having drop down lists. So far, I've been able to create a Macro button that will insert the row with all the same features as the others, however, it does not merge the cells that need to be merged. Here is the code I used to run the macro:
[FONT="]Sub InsertRowFormulas()[/FONT]
[FONT="]Application.ScreenUpdating = False[/FONT]
[FONT="]Dim cell As Range[/FONT]
[FONT="]Selection.EntireRow.Insert[/FONT]
[FONT="]For Each cell In Intersect(ActiveSheet.UsedRange, Selection.Offset(-1, 0).EntireRow)[/FONT]
[FONT="]If cell.HasFormula Then[/FONT]
[FONT="]cell.Copy cell.Offset(1, 0)[/FONT]
[FONT="]End If[/FONT]
[FONT="]Next[/FONT]
[FONT="]Application.ScreenUpdating = True[/FONT]
[FONT="]End Sub
Is there something I could add to make the the cells merge as well?[/FONT]
I'm not too advanced in excel. I developed a form that other people to complete. I need to have an option for them to add a line that will automatically format the same as the line above or below it, including some cells being merged and others having drop down lists. So far, I've been able to create a Macro button that will insert the row with all the same features as the others, however, it does not merge the cells that need to be merged. Here is the code I used to run the macro:
[FONT="]Sub InsertRowFormulas()[/FONT]
[FONT="]Application.ScreenUpdating = False[/FONT]
[FONT="]Dim cell As Range[/FONT]
[FONT="]Selection.EntireRow.Insert[/FONT]
[FONT="]For Each cell In Intersect(ActiveSheet.UsedRange, Selection.Offset(-1, 0).EntireRow)[/FONT]
[FONT="]If cell.HasFormula Then[/FONT]
[FONT="]cell.Copy cell.Offset(1, 0)[/FONT]
[FONT="]End If[/FONT]
[FONT="]Next[/FONT]
[FONT="]Application.ScreenUpdating = True[/FONT]
[FONT="]End Sub
Is there something I could add to make the the cells merge as well?[/FONT]