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: 1
Default Help:loop on two workbooks


Hi,

I am trying to loop on each sheet in a workbook. If any sheet o
interest is found, I need to copy the sheet into another workbook. M
code looks like as follows, but I keep getting error message "subscrip
out of range". Anyone could help me out. Thanks in advance.

For Each ws In ActiveWorkbook.Worksheets
i = 1
For i = 1 To 20
If ws.Name = Copy_list(i) Then

ws.Copy Befo=Workbooks _
("aa").Sheets(1)
Windows("bb").Activate
End If
Next
Nex

--
ana
-----------------------------------------------------------------------
anan's Profile: http://www.excelforum.com/member.php...fo&userid=2426
View this thread: http://www.excelforum.com/showthread.php?threadid=48369

 
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
Loop Through All Open Workbooks scott Excel Programming 11 February 1st 05 02:58 AM
Loop through open workbooks Bob Phillips[_6_] Excel Programming 2 April 28th 04 09:28 AM
Loop with two workbooks Mike Excel Programming 2 January 14th 04 07:15 PM
loop through workbooks Keith Willshaw Excel Programming 2 September 19th 03 12:48 PM
loop through workbooks Ron de Bruin Excel Programming 1 September 18th 03 02:53 PM


All times are GMT +1. The time now is 12:18 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"