Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 21
Default Select workbook with variable name.

I have some code that opens three workbooks simultaneously. Two workbooks
will contain source data while the third is the workbook to which I want to
copy source data. The destination workbook is not really a problem as it
will always have the same name so I can use that in the code. The two
workbooks with the source data will have names that change from week to week.
The name will be something like "Workbook Name_mmddyy" - the date being the
date on which the file was created. I will need to activate each of these
source workbooks in order to copy data. How do I reference the workbooks
when I don't have a name?

Thanks-
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 441
Default Select workbook with variable name.

You will need to be creative here. I don't have all your details, but you
could store all your source files in a separate folder. Then code an array to
return all the file names contained in that folder and process them. Once
they have been processed, move them to an archive folder, delete them, or
alter their name slightly, like add a 1 at the beginning of the file name.

If the latter method is used, then set your code not to process any file
with a leading 1 in the file name.

Very do-able.

Hope this helps.

"FinChase" wrote:

I have some code that opens three workbooks simultaneously. Two workbooks
will contain source data while the third is the workbook to which I want to
copy source data. The destination workbook is not really a problem as it
will always have the same name so I can use that in the code. The two
workbooks with the source data will have names that change from week to week.
The name will be something like "Workbook Name_mmddyy" - the date being the
date on which the file was created. I will need to activate each of these
source workbooks in order to copy data. How do I reference the workbooks
when I don't have a name?

Thanks-

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
Select a variable range Bluecat Excel Worksheet Functions 7 January 13th 09 01:24 AM
select cell by variable name Adam Excel Discussion (Misc queries) 6 May 20th 08 07:54 PM
Use a Variable to select a range Connie Excel Discussion (Misc queries) 3 October 19th 06 05:48 PM
Range("C9:V9").Select ==> changing the 9 to a variable B. F. Excel Worksheet Functions 8 May 23rd 05 01:16 PM
Select other workbook to select data in a macro. T Tromp Excel Programming 2 September 19th 03 01:43 PM


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