Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 20
Default Does file name contain the characters XYZ

Hi,

I'm trying to find out if a folder contains any files .

The name of the file varies but always contains _XYZ_

How would I find out if there is a file ?

I can do a file that I know the name of :

eg

If dir("\test.xls") = "" then
exit
else
end if

I think the answer is very simple but can't see it at the mo!

Thanks,

Ed

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 638
Default Does file name contain the characters XYZ

Sub Here()
If Dir("\*" & "_XYZ_" & "*.xls") = "" Then
MsgBox "nope"
Else
MsgBox "yup"
End If
End Sub

Ed Peters wrote:
Hi,

I'm trying to find out if a folder contains any files .

The name of the file varies but always contains _XYZ_

How would I find out if there is a file ?

I can do a file that I know the name of :

eg

If dir("\test.xls") = "" then
exit
else
end if

I think the answer is very simple but can't see it at the mo!

Thanks,

Ed


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
File names appended with ~ plus alphanumeric characters Augied Excel Discussion (Misc queries) 0 January 13th 09 04:23 AM
how to increase number of characters of file name in excel Manish Excel Discussion (Misc queries) 2 November 10th 08 10:24 AM
Unreadable characters in file with Print #File in VBA pieros Excel Programming 1 December 6th 06 02:51 AM
CSV file containing german characters imported into Excel Peter @ fjs Excel Discussion (Misc queries) 0 October 26th 05 05:32 PM
deleting last 4 characters from file name Hans Excel Programming 4 April 26th 04 01:50 PM


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