Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default opening consecutive files

Hi,

I've been trying to figure this out all weekend, but I'm kinda stuck. I
would like to open some text files in excel, copy some info into
another worksheet, then open another text file.

But I have to be order specific. So the first file is plate1.txt, then
open plate2.txt, and so on.
Any advice would be greatly appreciated,

jon

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,758
Default opening consecutive files

dim iCtr as long
dim myFileName as string

for ictr = 1 to 10 'whatever???
myfilename = "C:\my documents\excel\plate" & ictr & ".txt"
'your code to open and process and close
next ictr



Jay Noname wrote:

Hi,

I've been trying to figure this out all weekend, but I'm kinda stuck. I
would like to open some text files in excel, copy some info into
another worksheet, then open another text file.

But I have to be order specific. So the first file is plate1.txt, then
open plate2.txt, and so on.
Any advice would be greatly appreciated,

jon


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,588
Default opening consecutive files

you can do this in a loop

eg (untested)

dim x as integer
dim sDir as string

sDir="C:\datafiles\"

x=1
do while dir(sDir & "plate" & x & ".txt") <""

'process file here

x=x+1
loop



Tim


"Jay Noname" wrote in message
ups.com...
Hi,

I've been trying to figure this out all weekend, but I'm kinda stuck. I
would like to open some text files in excel, copy some info into
another worksheet, then open another text file.

But I have to be order specific. So the first file is plate1.txt, then
open plate2.txt, and so on.
Any advice would be greatly appreciated,

jon



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default opening consecutive files

thanks for the advice,
I'll give them a go this morning and let you know how it works out

jon

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
Consecutive date range on consecutive worksheets john3478 Excel Worksheet Functions 3 January 14th 09 10:54 PM
Opening files Chris J Dixon Excel Discussion (Misc queries) 0 September 15th 08 05:36 PM
show most recent files first when opening excel files Anne` Excel Discussion (Misc queries) 5 January 23rd 08 01:54 AM
Opening Quattro Pro for Windows files (*.WB1 Files) using Excel 20 PoundMutt Excel Discussion (Misc queries) 1 June 20th 07 03:50 AM
How can I view files chronologically when opening multiple files Stevilsize Excel Discussion (Misc queries) 3 July 26th 05 12:49 AM


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