Insert a line into all worksheets in one go.

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,
I would like to know if it is possible to insert a row into all sheets in a
workbook.
Thanks in advance,
Paul Cookson
 
try to right click a worksheet tab>select all sheets>insert the row>select
one sheet
 
Sub InsertRow_At_Change()
Dim i As Long
With Application
.Calculation = xlManual
.ScreenUpdating = False
End With
For i = Cells(Rows.Count, 1).End(xlUp).Row To 2 Step -1
If Cells(i - 1, 1) <> Cells(i, 1) Then _
Cells(i, 1).Resize(1, 1).EntireRow.Insert
Next i
With Application
.Calculation = xlAutomatic
.ScreenUpdating = True
End With
End Sub

Maybe this would help...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top