View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_6_] Bob Phillips[_6_] is offline
external usenet poster
 
Posts: 11,272
Default Help writing a macro

Yeah, selecting them all is a good idea. I like it <vbg

Bob


wrote in message
oups.com...
Here is a slight variation on Bob's solution.
I assume you have each sheet populated with staff members names.
I also assume the name are in col A or Col B startin at row 11 and
ending in row 39 (11+ 28).
The code below selects all of the sheets at once and then performs the
insertion of 2 rows beneath each staff member.

Sub AddRows()

Sheets(Array("Jan", "Feb", "Mar", "Apr")).Select '<== Add additional
sheets

For i = 12 To 96 Step 3
Worksheets(1).Rows(i).Select
Application.CutCopyMode = False
Selection.Insert Shift:=xlDown
Selection.Insert Shift:=xlDown
Next i

End Sub