Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Passing an argument to a quote

I have 140 spreadheets a1-a140.
I am interested in performing a task on each of them. I created a
macro that performs the task on 1 spreadheet.

I now would like to put this task in a For Next loop and be able to
make the counter run between 1-140

Here is a snippet:

For i = Startval To EndVal

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


My question: what is the appropriate syntax to change a1.xls to
a(i).xls so my spreadheet name will change automatically to a1-a140?

Thanks for your help
Zachh
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 72
Default Passing an argument to a quote

Zach,

Workbooks.Open Filename:= _
"M:\My Documents\Projects\a" & i & ".xls"

HTH
Henry

"Zach" wrote in message
om...
I have 140 spreadheets a1-a140.
I am interested in performing a task on each of them. I created a
macro that performs the task on 1 spreadheet.

I now would like to put this task in a For Next loop and be able to
make the counter run between 1-140

Here is a snippet:

For i = Startval To EndVal

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


My question: what is the appropriate syntax to change a1.xls to
a(i).xls so my spreadheet name will change automatically to a1-a140?

Thanks for your help
Zachh



Reply
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
Passing a range name as an argument to the Index Function Michael Sharpe Excel Discussion (Misc queries) 3 September 5th 12 01:33 PM
formula for % passing RKing Excel Worksheet Functions 2 August 30th 07 03:32 PM
Passing a row to a function dch3 Excel Worksheet Functions 2 July 31st 06 12:34 PM
Passing a UDF as an argument to a UDF puff Excel Discussion (Misc queries) 3 February 23rd 06 09:46 PM
Passing Variables Jeff Excel Discussion (Misc queries) 1 November 4th 05 06:46 PM


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

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

About Us

"It's about Microsoft Excel"