View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
L. Howard L. Howard is offline
external usenet poster
 
Posts: 852
Default Simple array macro works on one sheet only


This in a standard module only works on the sheet from which it is called.

Should it not do all four sheets run from any sheet?

Howard

Sub Plain_Copy()
Dim MyArr As Variant
Dim i As Long


MyArr = Array("Sheet1", "Sheet2", "Sheet3", "Sheet4")


For i = LBound(MyArr) To UBound(MyArr)

Sheets(MyArr(i)).Rows("2:2").Copy Rows("4:4")

Next 'i

End Sub