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


Hi All,
I need to cycle a set of command for each file in a list... the files
do not share folders, or filename structure or anything, so I really
need to hard-code the filenames in, and then define the next name after
each iteration. What's the best way of doing this... presumably define
an array of names and then cycle that?? How do I do that then?! :)

Thanks, as always,

Gareth


--
pianoman
------------------------------------------------------------------------
pianoman's Profile: http://www.excelforum.com/member.php...o&userid=33712
View this thread: http://www.excelforum.com/showthread...hreadid=547409

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Filename array


Excellent. Thanks guys! what would I do without this forum?! :)

Cheers


--
pianoman
------------------------------------------------------------------------
pianoman's Profile: http://www.excelforum.com/member.php...o&userid=33712
View this thread: http://www.excelforum.com/showthread...hreadid=547409

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Filename array

An added thought.
If the list of files will change, it might be easier to list them on a
worksheet then you can do

Dim v as Variant
with Worksheets("FileList")
set rng = .Range(.Cells(1,1),.Cells(1,1).End(xldown))
End With
v = rng.Value
for i = lbound(v) to ubound(v)
msgbox v(i,1)
Next

note that this is a 2D array with the second dimension 1 to 1.

--
Regards,
Tom Ogilvy


"pianoman" wrote in
message ...

Excellent. Thanks guys! what would I do without this forum?! :)

Cheers


--
pianoman
------------------------------------------------------------------------
pianoman's Profile:

http://www.excelforum.com/member.php...o&userid=33712
View this thread: http://www.excelforum.com/showthread...hreadid=547409



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Filename array


Thanks Tom,
Actually, I already have a list of entries from which I could derive
the filenames, so that may be the easiest thing anyway.

Thanks for the follow-up..
Gareth


--
pianoman
------------------------------------------------------------------------
pianoman's Profile: http://www.excelforum.com/member.php...o&userid=33712
View this thread: http://www.excelforum.com/showthread...hreadid=547409

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
Cell("filename") doesn't update to new filename when do save as. Louis Excel Worksheet Functions 2 March 22nd 07 07:27 PM
set filename to <filename-date on open bob engler Excel Worksheet Functions 2 July 13th 06 05:11 AM
Filename array Norman Jones Excel Programming 0 June 1st 06 12:51 PM
Filename array Ardus Petus Excel Programming 0 June 1st 06 12:47 PM
Saving filename same as import filename Matt Excel Programming 4 February 24th 04 03:01 PM


All times are GMT +1. The time now is 12:08 PM.

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"