View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
JaimeVasquez JaimeVasquez is offline
external usenet poster
 
Posts: 4
Default insert rows in Multiple worksheet

On May 26, 11:57 am, will wrote:

I’m trying to figure out an easy way for user to do this, like push a
button, to insert the required amount of row(s) in both sheets at the right
place but still not sure if this is feasible. Hope someone here can offer
some comments, thanks!



HI, see if this helps:

Private Sub CommandButton1_Click()
Dim iRow1 As Integer, _
iRow2 As Integer, _
sRows As String

iRow1 = 14
iRow2 = 17
sRows = iRow1 & ":" & iRow2

Sheets(Array("Sheet2", "Sheet3")).Select
Sheets("Sheet3").Activate
Rows(sRows).Select
Selection.Insert Shift:=xlDown
Sheets("Sheet3").Select
Range(Cells(iRow1, 1), Cells(iRow1, 1)).Select
End Sub


Saludos
Jaime Vasquez