LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
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
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Array code only works on selected sheet Howard Excel Programming 14 November 25th 13 08:31 AM
Complex conditional summing - array COUNT works, array SUM gives#VALUE fatcatfan Excel Worksheet Functions 4 November 18th 09 06:41 PM
Simple Macro Works on PC But Not Mac--Help! PBJ Excel Discussion (Misc queries) 3 July 31st 07 02:44 PM
simple copy column works but ERROR! Jack Excel Programming 2 November 30th 05 05:55 PM
Simple Macro, works in Excel 2002, 2003 but won't work in 2000 DJA[_2_] Excel Programming 5 September 28th 05 05:10 PM


All times are GMT +1. The time now is 03:26 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"