Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
 
Posts: n/a
Default To display contents of a folder in an excel sheet using Excel MACRO

Hi All,

i want to display some selected files (starting with a particular text)
from a folder to an excel sheet.
please tell me the MACRO code to implement the same.

Thanks,
Vishal

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Mallycat
 
Posts: n/a
Default To display contents of a folder in an excel sheet using Excel MACRO


Enter your folder path in cell A1

Sub myDIR()
myFolder = Range("A1").Value
x = 1
y = 1
Range("A2").Select
Selection = Dir(myFolder)
Do While y < ""
y = Dir
Selection.Offset(x, 0).Value = y
x = x + 1
Loop
End Sub

Matt


--
Mallycat
------------------------------------------------------------------------
Mallycat's Profile: http://www.excelforum.com/member.php...o&userid=35514
View this thread: http://www.excelforum.com/showthread...hreadid=554910

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
Selecting Last Sheet Bonbon Excel Worksheet Functions 17 February 22nd 06 04:16 PM
excel 4.0 macro remover tool Sachin Shah Excel Discussion (Misc queries) 0 August 25th 05 04:14 AM
Urgent Help Required on Excel Macro Problem Sachin Shah Excel Discussion (Misc queries) 1 August 17th 05 06:26 AM
is there anyway in an excel macro to reorder the sheet tabs from left to right? Daniel Excel Worksheet Functions 2 June 23rd 05 07:34 PM
Macro to copy range from Excel files in folder nc Excel Discussion (Misc queries) 1 June 15th 05 11:11 AM


All times are GMT +1. The time now is 08:53 PM.

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

About Us

"It's about Microsoft Excel"