ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   how do I import a list of music file names into excel (https://www.excelbanter.com/excel-discussion-misc-queries/183532-how-do-i-import-list-music-file-names-into-excel.html)

davydahl

how do I import a list of music file names into excel
 
I want to print a list of music files that I have in a folder on my hard
drive. How do I import only the file names into excel?

joel

how do I import a list of music file names into excel
 
You need a macro. Change the folder and file extension in the code below

Sub get_files()

Extension = "*.xls"
Folder = "C:\temp"
First = True
RowCount = 1
Do
If First = True Then
FName = Dir(Folder & "\" & Extension)
First = False
Else
FName = Dir()
End If
If FName < "" Then
Range("A" & RowCount) = FName
RowCount = RowCount + 1
End If
Loop While FName < ""

End Sub



"davydahl" wrote:

I want to print a list of music files that I have in a folder on my hard
drive. How do I import only the file names into excel?


Gord Dibben

how do I import a list of music file names into excel
 
Several methods to accomplish this.......I like Tushar's best if importing to
Excel.

To add a "Print Directory" feature to Explorer, go to
this KB Article.

http://support.microsoft.com/default...EN-US;q272623&

Or you can download Printfolder 1.2 from.....

http://no-nonsense-software.com/freeware/

I use PF 1.2 and find it to be more than adequate with custom
features.

OR Go to Command prompt and chdir to the folder with the files
Type DIR MYFILES.TXT

All the above create a *.TXT file which can be opened in Notepad and printed.

One more method if you want to by-pass the *.TXT file and pull
directly to Excel is to use Tushar Mehta's Excel Add-in. This allows filtering
and sorting once you have the data in Excel.

http://www.tushar-mehta.com/ scroll down to Add-insDirectory
Listing.

Download the ZIP file and un-zip to your Office\Library folder.


Gord Dibben MS Excel MVP


On Sat, 12 Apr 2008 19:02:00 -0700, davydahl
wrote:

I want to print a list of music files that I have in a folder on my hard
drive. How do I import only the file names into excel?



joel

how do I import a list of music file names into excel
 
Gord: What do you think of this change to your code?

@echo off
dir %1 /-p /o:gn "%temp%\Listing.csv"
start excel "%temp%\Listing.csv"
del "%temp%\Listing.csv"
exit

"Gord Dibben" wrote:

Several methods to accomplish this.......I like Tushar's best if importing to
Excel.

To add a "Print Directory" feature to Explorer, go to
this KB Article.

http://support.microsoft.com/default...EN-US;q272623&

Or you can download Printfolder 1.2 from.....

http://no-nonsense-software.com/freeware/

I use PF 1.2 and find it to be more than adequate with custom
features.

OR Go to Command prompt and chdir to the folder with the files
Type DIR MYFILES.TXT

All the above create a *.TXT file which can be opened in Notepad and printed.

One more method if you want to by-pass the *.TXT file and pull
directly to Excel is to use Tushar Mehta's Excel Add-in. This allows filtering
and sorting once you have the data in Excel.

http://www.tushar-mehta.com/ scroll down to Add-insDirectory
Listing.

Download the ZIP file and un-zip to your Office\Library folder.


Gord Dibben MS Excel MVP


On Sat, 12 Apr 2008 19:02:00 -0700, davydahl
wrote:

I want to print a list of music files that I have in a folder on my hard
drive. How do I import only the file names into excel?




joel

how do I import a list of music file names into excel
 
The dir has too many options. When excel reads the date it put the data into
multiple cells. This works better

dir %1 /b /o:n "%temp%\Listing.csv"

"Joel" wrote:

Gord: What do you think of this change to your code?

@echo off
dir %1 /-p /o:gn "%temp%\Listing.csv"
start excel "%temp%\Listing.csv"
del "%temp%\Listing.csv"
exit

"Gord Dibben" wrote:

Several methods to accomplish this.......I like Tushar's best if importing to
Excel.

To add a "Print Directory" feature to Explorer, go to
this KB Article.

http://support.microsoft.com/default...EN-US;q272623&

Or you can download Printfolder 1.2 from.....

http://no-nonsense-software.com/freeware/

I use PF 1.2 and find it to be more than adequate with custom
features.

OR Go to Command prompt and chdir to the folder with the files
Type DIR MYFILES.TXT

All the above create a *.TXT file which can be opened in Notepad and printed.

One more method if you want to by-pass the *.TXT file and pull
directly to Excel is to use Tushar Mehta's Excel Add-in. This allows filtering
and sorting once you have the data in Excel.

http://www.tushar-mehta.com/ scroll down to Add-insDirectory
Listing.

Download the ZIP file and un-zip to your Office\Library folder.


Gord Dibben MS Excel MVP


On Sat, 12 Apr 2008 19:02:00 -0700, davydahl
wrote:

I want to print a list of music files that I have in a folder on my hard
drive. How do I import only the file names into excel?




Gord Dibben

how do I import a list of music file names into excel
 
If I want a listing, I use Tushar's add-in.

Feel free to add any options to the DIR command.

Gord

On Sat, 12 Apr 2008 21:25:00 -0700, Joel wrote:

Gord: What do you think of this change to your code?

@echo off
dir %1 /-p /o:gn "%temp%\Listing.csv"
start excel "%temp%\Listing.csv"
del "%temp%\Listing.csv"
exit

"Gord Dibben" wrote:

Several methods to accomplish this.......I like Tushar's best if importing to
Excel.

To add a "Print Directory" feature to Explorer, go to
this KB Article.

http://support.microsoft.com/default...EN-US;q272623&

Or you can download Printfolder 1.2 from.....

http://no-nonsense-software.com/freeware/

I use PF 1.2 and find it to be more than adequate with custom
features.

OR Go to Command prompt and chdir to the folder with the files
Type DIR MYFILES.TXT

All the above create a *.TXT file which can be opened in Notepad and printed.

One more method if you want to by-pass the *.TXT file and pull
directly to Excel is to use Tushar Mehta's Excel Add-in. This allows filtering
and sorting once you have the data in Excel.

http://www.tushar-mehta.com/ scroll down to Add-insDirectory
Listing.

Download the ZIP file and un-zip to your Office\Library folder.


Gord Dibben MS Excel MVP


On Sat, 12 Apr 2008 19:02:00 -0700, davydahl
wrote:

I want to print a list of music files that I have in a folder on my hard
drive. How do I import only the file names into excel?






All times are GMT +1. The time now is 11:06 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com