Hi
Can somebody help with a short easy code to open a browser to select a folder and list the files in that folder in excel. I do not want to include sub directories.
Thank you
Hi
Can somebody help with a short easy code to open a browser to select a folder and list the files in that folder in excel. I do not want to include sub directories.
Thank you
Last edited by CobraLAD; 04-30-2009 at 02:37 AM.
Hi
Run this code, select the directory, then cancel and the list of files will be displayed in column A.
HTH![]()
Sub aaa() Application.GetOpenFilename filess = Dir("*.*") Do While Not filess = "" Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).Value = filess filess = Dir() Loop End Sub
rylo
thank you rylo
rylo
this works 100%, but how do I add the path with the file name for example
C:\My Work\book1.xls
Hi
try changing
to![]()
Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).Value = filess
rylo![]()
Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).Value = curdir & "\" & filess
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks