Hello Friends,
I need a code to get all excel file names in a folder. File names should be like full names as "C:\Users\Vikas'\Desktop\Mail Macro.xlsx" .
Please let me know in case of any concern.
Thanks,
Liz.![]()
Hello Friends,
I need a code to get all excel file names in a folder. File names should be like full names as "C:\Users\Vikas'\Desktop\Mail Macro.xlsx" .
Please let me know in case of any concern.
Thanks,
Liz.![]()
Last edited by Liz_Biz; 04-14-2014 at 09:24 AM.
Perhaps like this?
Looking at your folder I'm not really sure of the full folder name. Does it stop at "Desktop" or is it Desktop\Mail?![]()
Please Login or Register to view this content.
If so change sPath to "C:\Users\Vikas'\Desktop\Mail\" and make the same chamge in fName.
Alf
Last edited by Alf; 04-13-2014 at 09:01 AM.
Hi Alf,
Thank you so much for looking into this.
Code is working as expected. This need a little add on.I have tried but failed.
Is it possible that code will ask user to enter folder path ? Ex. Code will ask for "C:\Users\Vikas'\Desktop\"
Thanks,
Liz![]()
Here's another..
![]()
Please Login or Register to view this content.
Hi apo
Nice code and this is the right answer the question Liz didn’t ask in her first post.
I'm a bit puzzled by this part
I thought this would only find ".xls" files but it finds ".xlsx" and "xlsm" as well. Would you care to explain?![]()
Please Login or Register to view this content.
Alf
Hi Alf..
I am not sure of the technical reason why.. but if you go to the Command prompt and type Dir *.xls when in a directory that has xls/xlsx/xlsm files.. it will list them all..
I originally posted the code and workbook without the wildcard after the xls.. but then changed it (thinking i needed to) .. but like you say.. it is actually not needed..
Thanks for feed back. This seems to be another case of "Excel moves in myserious ways its miracles to preform"
Alf
You got me thinking... so i did some gooogling...
Here are some interesting discussions on it..
http://www.mrexcel.com/forum/excel-q...lsx-files.html
http://www.pcreview.co.uk/forums/dir...-t1628303.html
btw.. thanks for the rep points..![]()
So it's back to basic sorry DOS of course.
Well this is good to know since writing macros looking for excel files with specific formate is not that unusual.
Alf
Thanks Alf & Apo. I got my solution but can't mix it in my mind. Thank you so much.![]()
Hi Liz
Thanks for feed back and rep.
Alf
Hi Apo,Originally Posted by apo
Here is my query.
I want to select file(s) via dialog box and get path for that only and not for all files in that folder.
It may be more than one.
Thanks,
Liz
Last edited by Liz_Biz; 06-21-2014 at 01:04 AM.
Try this...
Change the InitialFilename path to suit..
![]()
Please Login or Register to view this content.
Apo,
This is working as expected but its pasting path in cell (1,1). I need this in cell (2,6).
Also, If I run it 2nd time, its pasting data from first cell again not from the last blank cell of 6th column.
I know, I am giving you more trouble, but please help me. It can save my neck.
Thanks,
Liz.![]()
Last edited by Liz_Biz; 06-21-2014 at 08:55 AM.
You only need to change this:
to this:![]()
Please Login or Register to view this content.
![]()
Please Login or Register to view this content.
Excellent !! You helped me a lot. Thank you so much!!!![]()
Thanks!!! Excelforum.com!!!
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks