Re: Show Filename Only in ComboBox Pulldown



Hmmm. Let me add the code that I have and maybe that may be helpful. I'm
not clear or how to incorporate that code you forwarded to show only my
filename and not the entire filepath in the combobox pulldown?

============
Private Sub UserForm_Activate()
Me.ComboBox1.Clear
With Application.FileSearch
.NewSearch
.LookIn = "C:\Temp"
.Filename = "SN1008" & "*.txt"
.SearchSubFolders = False
.Execute
For i = 1 To .FoundFiles.Count Step 1
Me.ComboBox1.AddItem .FoundFiles(i)
Next i
End With
End Sub
===================

Kind regards,

D.Parker

"Jim Cone" wrote:

> D,
>
> Use the "Dir" function...
> '-----------------------------
> Sub FileNameTest()
> Dim strPath As String
> Dim strName As String
> strPath = "C:\Program Files\Intel\Intel Application Accelerator\iATAenu.dll"
> strName = Dir(strPath)
> MsgBox strName
> End Sub
> '-----------------------------
>
> Jim Cone
> San Francisco, USA
>
>
>
> "D.Parker" <DParker@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
> news:34C643D4-E029-4119-AE39-DCFA19A0A3BE@xxxxxxxxxxxxxxxx
> This is an continuation post from 6/26. JMB showed me the code to add to
> utilize FileSearch inconjunction with UserForms. The code works great,
> unfortunately the entire "path" (C:\.....\<filename>.txt) shows up in my
> combobox pull down. Is there a way to show only the filename and not the
> actual path to the file in the combo box?
>
> Kind regards,
>
> D.Parker
>
.



Relevant Pages

  • RE: Need Code for Opening Old Files
    ... ' Sub Purpose: change from FileSearch to recursive DIR ... Dim blnSubFolders As Boolean ... Dim strArrAs String ... Dim strName As String ...
    (microsoft.public.excel.programming)
  • Re: Renaming loaded file and deleting the old file
    ... Sub FileSave() ... Dim SmartFName As String, CurFName As String, sPath As String, iMsg As Integer ... 'GetSmartFName derives a filename based on the document variables ... filename to a filename generated by looking at the document variables. ...
    (microsoft.public.word.vba.general)
  • Re: Auslesen einer in einem Archiv gespeicherten XML
    ... Private Sub Button1_Click(ByVal sender As System.Object, ... Dim findFilesDeleg As New LoadDelegate ... fileName) ... Delegate Sub LoadDelegate(ByVal WebResource As String, ...
    (microsoft.public.de.german.entwickler.dotnet.vb)
  • Re: Dynamically Adding Controls
    ... "Shock" wrote in message ... >> End Sub ... >> Dim commaPos As Integer, examTitle As String, usrName As String ... >> Dim fileName As String, subname As String, cCheck As CheckBoxList ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Custom save as pathname and filename
    ... Sub SetUNCPath(szPath As String) ... Dim lReturn As Long ... > So now I need to get that filename into the Save As dialogue (probably the ...
    (microsoft.public.excel.programming)

Loading