Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default File name seach within open filetype

Ladies & Gents,

I use a macro to open a number of files with a similar name, format & save
them, then open a number of different files with simlar names, format & save
those. The files are named *A.csv, and *B.csv. All of the file reside in
the same folder, but that folder changes regularly, and is not the same
folder which holds the macro. The code below will open mulitple files with
a similar type;

Sub Look_For_File_Type() ' Test 3
Dim fn As Variant, f As Integer
fn = Application.GetOpenFilename(" Text files,*.csv", 1, "Select One Or
More Files To Open", , True)
If TypeName(fn) = "Boolean" Then Exit Sub
For f = 1 To UBound(fn)
Debug.Print "Selected file #" & f & ": " & fn(f)
Workbooks.Open fn(f)
MsgBox ActiveWorkbook.Name, , "Active Workbook Name:"
ActiveWorkbook.Close False ' close the active workbook without
saving any changes
Next f
End Sub

How do I make the code search for all *A.csv files?



Thanks in advance.

Andrew


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
excel seach Excel-lent Novice Excel Worksheet Functions 1 June 27th 08 11:12 PM
Read from filetype Jeff Excel Discussion (Misc queries) 2 June 4th 08 04:29 PM
.FileType = (.csv files) ?? Dave Excel Discussion (Misc queries) 0 June 21st 07 02:16 PM
function to seach directory for file location Kevin Excel Worksheet Functions 1 August 28th 06 04:34 PM
seach and replace '(' with an '/' Splt Window Diner Excel Discussion (Misc queries) 4 August 20th 05 03:19 PM


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