Re: Show Filename Only in ComboBox Pulldown



Gentlemen, I have tried both methods and the combobox has the text file, but
I continually get error 53 (file not found). Prior to this change it was
finding the file and getting the data from the file and dumping into the
appropriate cell. Is there something else I need to change to use either of
these methods? Thank you.

Kind regards,

D.Parker

"Dave Peterson" wrote:

> If you're using xl2k+:
>
> Change:
> Me.ComboBox1.AddItem .FoundFiles(i)
> to
> Me.ComboBox1.AddItem mid(.FoundFiles(i),instrrev(.foundfiles(i),"\")+1)
>
>
> I think Jim wanted you to try:
>
> Me.ComboBox1.AddItem dir(.FoundFiles(i))
>
>
>
>
> D.Parker wrote:
> >
> > 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
> > >
>
> --
>
> Dave Peterson
>
.



Relevant Pages

  • Re: Show Filename Only in ComboBox Pulldown
    ... with different GMT timestamps contained within the filename. ... be a super long combobox. ... OKButton_Clicksub? ... >> On Error GoTo ErrorMsg ...
    (microsoft.public.excel.misc)
  • Re: Userfrm Lookup Works For text not Number
    ... combobox, so the click event for the combobox is appropriate. ... > Kind Regards ... > "Tom Ogilvy" wrote in message ... >>> Private Sub UserForm_Initialize ...
    (microsoft.public.excel.programming)
  • Re: RE: User Forms
    ... I have the FillCboBoxList sub in the userform module. ... ComboBox named: ComboBox1 ... click on, say, letter A, I want the control to populate my cbo box with ... Right-Click on the Excel icon ...
    (microsoft.public.excel.newusers)
  • Re: ComboBox unique ValueMember and non-unique DisplayMember
    ... the combobox because there will be no associated ID with the text they type. ... >> Public Sub New ... >> Friend WithEvents TextBox2 As System.Windows.Forms.TextBox ... >> Private Sub Form3_Load(ByVal sender As System.Object, ...
    (microsoft.public.dotnet.framework.windowsforms)
  • Re: RE: User Forms
    ... I have the FillCboBoxList sub in the userform module. ... ComboBox named: ComboBox1 ... Right-Click on the Excel icon ...
    (microsoft.public.excel.newusers)

Loading