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: 2
Default Excel Visual Basic - need help to create a loop of filenames

New VBA user here! :o)


I have created a sub which calls individual Excel worksheets and copy
certain rows into a new worksheet. Pretty basic.


All of the .xls file I am calling are sequential..ie project (1),
project (2), project (3), and so on.


Instead of listing each workbook individually, can I create some kind
of loop which will call up each workbook; like project (#+1).xls?


Here is the basics of the sub I am using:


Workbooks.Open Filename:=filepath & "project (1).xls"
Call copy_rows_into_new
Windows("project (1).xls").Activate
ActiveWorkbook.Close


Workbooks.Open Filename:=filepath & "project (2).xls"
Call copy_rows_into_new
Windows("project (2).xls").Activate
ActiveWorkbook.Close


etc. etc. etc.


Thanks for any assitance!!

 
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
Is Visual Basic the same as Visual Studio 2008? Mike Stewart Excel Worksheet Functions 5 January 11th 09 04:58 PM
How to create Automatic Filenames in Excel Trevor6410 Excel Discussion (Misc queries) 1 November 23rd 05 05:05 PM
Create and Use Button Menu using visual Basic in Excel Walter L. skinner Excel Discussion (Misc queries) 3 November 17th 05 11:40 AM
changing the visual basic in office 2003 to visual studio net bigdaddy3 Excel Discussion (Misc queries) 1 September 13th 05 10:57 AM
Excel/Visual Basic MikeS[_2_] Excel Programming 1 October 12th 04 04:06 PM


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