Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Excel VBA > Excel VBA
|
Excel VBA Discuss using VBA for Excel programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Excel VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 8th, 2007, 08:45 PM
Authorized User
 
Join Date: Mar 2007
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Default How to do a master list

I have a lot of DAT files and named with product
I want to do a master list for these DAT files.
Is it possible to use marco to complete

 
Old August 8th, 2007, 11:29 PM
Friend of Wrox
 
Join Date: Sep 2005
Posts: 812
Thanks: 1
Thanked 53 Times in 49 Posts
Default

Hi

What to you mean by masterlist - Is it a list of dat files. You can use the Dir function to get it

http://vbadud.blogspot.com/2007/05/v...rectories.html

Cheers
Shasur

http://www.dotnetdud.blogspot.com
 
Old August 9th, 2007, 01:01 AM
Authorized User
 
Join Date: Mar 2007
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks Shasur,

youe are right I want to get a list of all file name.

 
Old August 9th, 2007, 01:30 AM
Authorized User
 
Join Date: Mar 2007
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Shasur,

I just one change in your marco but i am fail to get the file name list that I want. Would you please give more help to me?
sSubDir = GetSubDir("d:\trash\")=> sSubDir = GetSubDir("d:\AR\")
All my DAT files are inside("d:\AR\")

Thanks a lot

 
Old August 9th, 2007, 02:46 AM
Friend of Wrox
 
Join Date: Sep 2005
Posts: 812
Thanks: 1
Thanked 53 Times in 49 Posts
Default

Here is the modified version

Sub Get_All_SubDirectories()

Dim arSubDir() As String
Dim sSubDir As String

sSubDir = GetSubDir("d:\AR\", "*.dat")

' -----------------------------------------------------------
' Coded by Shasur for http://vbadud.blogspot.com
' -----------------------------------------------------------

If LenB(sSubDir) <> 0 Then
arSubDir = Split(sSubDir, ";")
For i1 = 0 To UBound(arSubDir)
    ' Here you will get the list of Dat files
    Debug.Print arSubDir(i1)
Next i1
End If

End Sub


http://www.dotnetdud.blogspot.com





Similar Threads
Thread Thread Starter Forum Replies Last Post
multi-column list box values moved to 2nd list box sbmvr Access VBA 1 May 14th, 2007 01:58 PM
Populating master table with list from list table sburgess Access 7 September 1st, 2006 06:03 AM
fill dropdown list with items when parent list isaac_cm Pro PHP 1 July 10th, 2006 05:41 AM
List tablesname from database & list databasename ittorget MySQL 3 September 10th, 2005 03:06 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.