Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default List Filenames from Folder

Hi,

I wonder if it's possible to populate a column in excel with filenames that
come from a folder. I need only to import only the file names and not any of
the data within the files.

All the files names that I need end with *.txt

Thanks,

Eskimo
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default List Filenames from Folder

Try something like

Dim Rng As Range
Dim FName As String
Set Rng = Range("A1")
FName = Dir("H:\Test\*.txt") '<<< CHANGE PATH
Do Until FName = ""
Rng.Value = FName
Set Rng = Rng(2, 1)
FName = Dir()
Loop

--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"Eskimo" wrote in message
...
Hi,

I wonder if it's possible to populate a column in excel with
filenames that
come from a folder. I need only to import only the file names
and not any of
the data within the files.

All the files names that I need end with *.txt

Thanks,

Eskimo



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
getting filenames from a user selected folder Mitch Excel Programming 3 June 10th 05 04:55 PM
Look for a string in filenames in a folder? FrigidDigit Excel Programming 2 May 24th 05 04:31 PM
Getting a list of filenames Tom Ogilvy Excel Programming 3 April 13th 05 04:31 PM
Help with a Macro to list all filenames and mod dates in a folder techmoney Excel Programming 3 November 19th 04 09:52 PM
Folder and filenames? Mark[_45_] Excel Programming 6 July 1st 04 03:49 AM


All times are GMT +1. The time now is 01:15 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"