Constant? in VBA

H

have_a_cup

I have a macro I need to run daily on anywhere from 5-20 exce
reports...I've pasted the code below...the code fails out at portio
i've bolded and underlined below, and my question is:

What do I need to do, syntax wise, to make this happen regardless o
the name of the workbook....all the workbooks would be named RBA w/
numeral extension...

Sheets("Current Rules - 1").Select
ActiveSheet.Shapes("Picture 1").Select
Selection.Cut
Rows("1:4").Select
Range("BC1").Activate
Selection.Delete Shift:=xlUp
ActiveWorkbook.Save
Sheets("Current Rules - 1").Select
Sheets("Current Rules - 1").Copy
ActiveWindow.WindowState = xlNormal
With ActiveWindow
.Top = 105.25
.Left = -5.75
End With
*_Windows(\"rba_11.xls\").Activate_* Wit
ActiveWindow
.Top = 22
.Left = -76.25
End With
ActiveWindow.Clos
 
J

JLatham

Wrap your .Activate line inside of this type of structure:

Dim AnyWorkbook As Workbook
For Each AnyWorkbook In Workbooks
If Left(UCase(AnyWorkbook.Name),3) = "RBA" Then
Windows(AnyWorkbook.Name).Activate
With Active Window
..... your code here
End With
End If
Next
 
Top