View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Insert rows on multiple sheets

Sub Tester4()
Worksheets.Select
ActiveCell.Offset(1, 0).EntireRow.Select
Selection.Insert
Selection.Offset(-1, 0).EntireRow.Select
Selection.EntireRow.Borders(xlEdgeTop).LineStyle = xlNone
Worksheets("Sheet1").Select

End Sub


"Steve" wrote in message
news:3fabaab3$2$18253$afc38c87@...
Hi everyone. I have a workbook with 4 sheets in it. Sheet 1....Sheet 4.

The user will always be on Sheet1. I wrote simple macro that inserts a

row
under the active cell when the user hits Ctl I:

ActiveCell.Offset(1, 0).EntireRow.Insert
ActiveCell.Offset(1, 0).Activate
ActiveCell.EntireRow.Borders(xlEdgeTop).LineStyle = xlNone

So for instance, if the active cell is on row 25, a row is inserted

beneath.
My question: how do I get the macro to also insert a row under row 25 on
the 3 other sheets?

Thanks!!