View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
michael.beckinsale michael.beckinsale is offline
external usenet poster
 
Posts: 274
Default DECLARE VARIABLES PROBLEM

Hi ytayta55,

From a brief look at your code & requirements you need to loop through
the 231 workbooks. Try including something like this:

For Each i From 1 to 231
Set FromWks = Workbooks("YTA" & i & ".xls").Worksheets("sheet1")
existing code<<<

Next i

Also put his at the beginnning of your code to speed things up:

Application.ScreenUpdating = False
Application.Calculation = xlManual

Also much of your code is inefficient, you should always try to avoid
selecting, so replace this type of statement:

Sheets("1").Select
Range("C22001:BB44005").Select
Selection.ClearContents

With:
Sheets("1").Range("C22001:BB44005").ClearContents

HTH

Michael