hello, everyone
i am using below to get file from directory in listbox Userform
but i want show files from folders and subfolders tooPlease Login or Register to view this content.
thanx
hello, everyone
i am using below to get file from directory in listbox Userform
but i want show files from folders and subfolders tooPlease Login or Register to view this content.
thanx
Use Code-Tags for showing your code :
Please mark your question Solved if there has been offered a solution that works fine for you
If You like solutions provided by anyone, feel free to add reputation using STAR *
Subfolders where exactly? What would be the new top starting directly into which you want to dive down from?
_________________
Microsoft MVP 2010 - Excel
Visit: Jerry Beaucaire's Excel Files & Macros
If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
Always put your code between code tags. [CODE] your code here [/CODE]
?None of us is as good as all of us? - Ray Kroc
?Actually, I *am* a rocket scientist.? - JB (little ones count!)
Hello HaroonSid,
Try this...
Module Macro Code
UserForm CodePlease Login or Register to view this content.
Please Login or Register to view this content.
Sincerely,
Leith Ross
Remember To Do the Following....
1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.2. Thank those who have helped you by clicking the Star below the post.3. Please mark your post [SOLVED] if it has been answered satisfactorily.
Old Scottish Proverb...
Luathaid gu deanamh maille! (Rushing causes delays!)
How does this work out for you?
Had to put it in textfile because site won't let me post wscript code.
Avoid using Select, Selection and Activate in your code. Use With ... End With instead.
You can show your appreciation for those that have helped you by clicking the * at the bottom left of any of their posts.
Bakerman, the forum server does not like HTML being posted, and it probably thought that was what you were posting
1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
2. If your question is resolved, mark it SOLVED using the thread tools
3. Click on the star if you think someone helped you
Regards
Ford
OK Ford, thanks for clarifying.
Thanx for the reply
@Leith Ross
i uploaded the sample workbook with yours code
it getting mismatch error
plz look here, what i am doing wrong
You forgot to put in FileFilter.
Please Login or Register to view this content.
Thanx a lot bakerman2
its working perfectly
but i want little change in code.
i don't want to show the file path only show file name in listbox
Change this
to thisPlease Login or Register to view this content.
Please Login or Register to view this content.
thanx a lot Bakerman2 and Leith Ross
thread closed
sorry for disturb again
but i want to open file which are showing in listbox with command button
Last edited by HaroonSid; 02-03-2017 at 11:36 AM.
Then taking out the full path was probably a mistake.
Design suggestion: perhaps the routine actually compiles the complete list of files in a hidden sheet. Column A is the path to the file, Column B lists the found filename. Use column B to populate your Listbox. When a file is selected you will have column A still available to quickly get to the file itself.
You will need to consider and resolve issues with files of the same name in more than one folder.
Hello HaroonSid,
Please try the Code below in a new Workbook. Maybe that is what you are after?
Regards.Please Login or Register to view this content.
Please consider:
Be polite. Thank those who have helped you. Then Click on the star icon in the lower left part of the contributor's post and add Reputation. Cleaning up when you're done. If you are satisfied with the help you have received, then Please do Mark your thread [SOLVED] .
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks