Passing an argument to a quote

Z

Zach

Hi,

I have 140 (a1-a140) spreadsheets on which i am interested in
performing a particular task. I wrote a code to perform that task on a
single spreadsheet. Example below:


Workbooks.Open Filename:= _
"M:\My Documents\a1.xls"
Sheets("Board - General").Select
Rows("1:1").Select
Selection.Delete Shift:=xlUp

I now would like to incorporate the above code into a For next loop

For i = Startval To EndVal

My question is how do i rename the spreadsheet in "M:\My
Documents\a1.xls"
so it will take the values a1-a140 using the i counter. (Startval will
be 1 and endval will be 140).


Thanks for your help,
Zach
 
M

Myrna Larson

Of course that line goes inside a

For i = 1 to 140
Workbooks.Open ......

Next i

loop.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top