Jump to content

Recommended Posts

Posted

How can i take the name of .txt file, in a multiselection?

 

i have done this:

 

Dim lngCount As Long ' Open the file dialog
With Application.FileDialog(msoFileDialogOpen)'.AllowMultiSelect = True
   .Show ' Display paths of each file selected
For lngCount = 1 To .SelectedItems.Count 'MsgBox .SelectedItems(lngCount)
Next lngCount

 

after that, use data extract on .txt, and process the informations, but i need the name of each .txt file

For the name of .txt file, i have to take the files again, with that code:

 

Dim txtname As String
   txtname = Application.GetOpenFilename("text files (*.txt), *.txt,")

 

I don't wanna take each .txt file, i want to take only in the first selection, and record the name in a new variable

 

This is a vba for excel, but is a complement of my lisp...

 

I will be very grateful with any help!!

Posted

What do you mean by first selection? I am assuming that you mean from a drop down box or a similar form object.

 

If that is the case you will be able to determine the order of the items in the box by iterating through the list. Compare the selected item list against the contents of the form object.

 

Does this need to be a multi selection if you are only using the first txt file?

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...