List Filename, Location & Attributes Of Files In Folder
May 21, 2008
Sorry that I'm very new in Excel VBA coder. And, for this topic, I don't even know how to start. I want to make a MS Excel database of a numerous files. This database must be consist of Filename, Location, and it's attribute (let's say updated date, size, hidden status)
i want to use the "Browse for Folder" to select the folder where the files is in eg. E:My DocsGlobal and list the folder location and filenames to table (column I:J), and color them according to every folder location.
I would like the "Browse for Folder" windows to be able to select multiple files instead of just one file a time.
I want to do in VBA is to be able to read and place in a variable the image Width and Height of an image in a folder. I can (with help from here) read the filenames in folder. But is there a way in Excel to read the above attibutes?
I have a problem with getting the list of files in subfolders. this code is writing the names of files in a folder to column "A". But it is just "target" folder. But i need to get the name of all files not just under the target folder but also subfolders of target and even subfolders of subfolders of target
VB: Dim FSO As Object Dim SourceFolder As Object Dim FileItem As Object [code]....
Here is a macro I have found and manipulated for my particular case. The problem is that I want to narrow the search criteria by just pdfs and only those starting with Segment which i know in coding would be something like "Segment" & "*" & ".pfd" or something to those terms but the code uses objects which I'm not too familiar with.
Code: Sub ListAllFile()
Dim objFSO As Object Dim objFolder As Object Dim objFile As Object Dim ws As Worksheet
Set objFSO = CreateObject("Scripting.FileSystemObject") Set ws = Sheets("Simple Cut Lists (2)")
I have a folder containing many Excel files. Each is unique, and I wish to characterise them in a separate contents file in Excel. To do so, it would be very useful to populate a worksheet with the names of the files in the folder.
We use Excel 2003 and 2007 to track labor data for a field service company. The field tech's complete daily forms and the office staff copy/paste this data into weekly billing worksheets. They use naming conventions to show the jobs and dates in the file name (Daily Labor - Job1 - 031308.xls and Weekly Labor - week ending 3-16.xls. What I would like to do is link the daily data to the weekly forms as they come in. Is there some way to do this when the job names and the dates are always different? Can I tell Excel to expect data files based on the naming conventions as in the Weekly is named "Weekly Labor - Week Ending 3-16.xls so data files named LaborJob1310.csv, laborjob1311.csv would automatically update the weekly sheet? I can put these in a folder and link them, but I don't know how to provide an easy way to do this for the upcoming week.
I have a question about creating a custom drop down menu. In AutoCAD, I can create custom drop down menus that loads each time AutoCAD loads and i was wondering if excel have something similar. This menu would be added to the default menu list: "File_Edit_View_Insert_Format_Tools_Data...etc". I have searched online but i keep getting things about how to make drop down menus in cells but nothing about adding a main drop down menu.
What I want to do is create a menu with hyper links to all of the excel files we use quite often here at work.
I have already done this by just creating a sheet with a list of hyper links on it but would like to put it in a drop down menu instead if its possible.
The following code is something that was developed to find files with certain criteria that matches references in cells A1 & A2. The coding is as follows:
Code: Option Explicit Option Compare Text 'for Case-Sensitive matching change Text to Binary Sub List_Matches() Dim sPattern As String, sPath As String, sJob As String Dim sMainDir As String, sCommonSub As String Dim c As Range, lRow As Long
The red is the area of the code i am having problems with. The original code was going to look only in one directory, now I wanted to add a second directory with reference located in E5. Now as is the program works fine looking at directory 1 or E4, but the problem i feel is that for E5 all the folder name are named "WO#_____ - ______". I believe the # sign is not allowing it to open that folder and search for the info. In the code there is a function for solving the # sign problem in a file name, but how could i either modify the code or the function to do the same for the folder name and view the # sign as a valid file name to open?
creating a macro, I have a list of CSV files in a folder called balances, i need a macro that will look into each CSV file and grab all p'folios which have a negative balance in Col D and line them up as per example shown below. The extracted data needs to be copied to file named "Workings" S:RecsalancesWorkings
All data in CSV file looks like this, where header row is row 1 starting at A1
I am unable to install a disk catalog and have been trying with no success to try and get something in excel that will look at a directory and display the contents of that folder with the file attributes etc
Essentially, the Engineering Dept has given me 550 AutoCad files I have dumped into a folder located in this path: C:/DrawingsDump
From these 550 DWG files I need to manually filter and separate 260 drawings that I actually need to use and move them to a folder located in this path: C:/DrawingsFiltered . This manual filtering process takes a lot of time and is tedious work and it has got to be done everytime Engineering changes drawings because they are not kind enough to provide me a delta list.
In Excel 2003 I have setup a list of all 260 drawings I am interested in and that I call my filtered list. Is it possible to create a script that will enable Excel 2003 to compare my filtered list to all of the files inside C:/DrawingsDump, and then copy only those files that match to my Excel Filtered list and then paste only matching files into the C:/DrawingsFiltered folder?
If Excel 2003 can't handle this, is there a third party application that will let me perform a file management function like this with minimum startup time?
I require a bit of code that locates where the excel file is stored - it then searches that directory folder for all file names. Any file names with an extension *.hm for example are listed in column A, while their relevant 'Dates of last Modification' are listed in Column B.
Every time the spreadsheet opens it should ask the user if he/she requires a re-search of this directory and update of any file names accordingly. NB: if a file name is deleted from the directory, the file name should remain in the spreadsheet.
I have a list of user attributes which I would like to merge into a template. I have attached a copy of the template and a copy of the user attributes sheet. The attributes have been downloaded directly from a database so there is one attribute per line. For eg 1 user may have 5 cost centres assigned to him. I would like the 5 costs centres to show up under the template. The problem I have is the template is set up for one line per user with multiple fields for cost centres, therefore I need some way of taking the following output.
User Attribute Value 111 CC CA1023 111 CC CA1204 111 CC CA3333
And merging into the following template
User CC1 CC2 CC3 111 CA1023 CA1204 CA3333
Each user has multiple attributes (Cost centre, internal order, etc) I am only worried about the cost centre field for the time being. Also each user may have 0-10 cost centres assigned
I have a spreadsheet that from a button I want to run a macro that will input todays date, the value in cell A1 as the filename into a default dialog box that is at a default file path. I have been trying to do this for several hours and can not completely get it done.
I have created a separate SAVE button that when the user hits that button, it saves the file in a network drive using the current date as part of the save-file name. Ie: Sheet20070408.xls, Sheet20070409.xls, Sheet20070410.xls, and Sheet20070411.xls.
I am currently working out all the "idiot proof" safety features. My code looks something like this:
Why am I saving it twice? When the user clicks SAVE, I want to save over the copy of the current sheet they use, even if they save it on their desktop, and then save it to the network drive. This way, if they keep a second copy in an easy to find location, it will save the data to that sheet as well. Just in case they forget to save on the current sheet. I need to be sure each copy of the file has the most up-to-date information, as well as save a copy for retention.
My question is this: Can I search a folder for an existing file name? If the user goes into the network drive to open an old file for retention and they click SAVE, I don't want to accidentally overwrite a file in the retention folder.
I need a macro in a workbook to look at all the files in the same folder that have "*att*.xls" in the name and determine and copy from the range A15:W515 only the rows that have data in at least columns A, C and D. Each file will vary as to how many rows there will be and there are more than the files with "*att*.xls" in the folder. The data will be on the only worksheet in each file and the worksheet is named "G2WAttendee_xls" the data from all the files need to be copied to the file called "Consolidated webinar reports.xls" (I am using Excel 2003) and to a sheet called "Attendance Data" and added to the end of the last paste.
At the start of the macro the current file "Consolidated webinar report.xls" should be saved to a sub folder of the current directory and have the date saved added to the name. The sub folder is called "Completed reports". The data in the original file on worksheet "Attendance Data" should be deleted.
At the end of the process all the files that have had data copied from them should be moved to the sub folder "Attendance reports consolidated" (This could be done as each file is closed if that is easier).
I have headings in row 1 of the "Attendance Data" worksheet that match the headings in the various files in the folder (which will always be in row 14 of the individual "*att*.xls" files).
The folder with all the files and the "Consolidated webinar report.xls" file is at path "Z:P and S MEvaluationsWebinar series 2012-13TB".
I would like excel to create the folder C:/Bill if it doesn't already exist when I click save/save as option and save the workbook in it with a filename that is a combination of text/values in cells A1 and A2 on Sheet1. Better if the save as dialog box appears with this option selected so that I have to just click Save in the save as dialog box to save it in "C:/Bill".
I'm trying to use the code below to paste special my first sheet to remove the formulas, then delete all other worksheets then save as a reference number (which is linked to the worksheet im saving) but I also need it to save in a specific folder.
I want to allow users to place files (.jpg, .tif, .pdf, .pps etc) into a network folder and then have my program open each file and display it for 30 seconds then close the file and the application before opening the next file.
1. Set up a loop to get a directory listing of the folder and write the listing to a text file.
2. Open up the text file and get the next filename in it
3. Open the file in the associated application
4. Wait for 30 seconds (or some period of time) and then close the file
5. Repeat steps 2-4
DoIt = 1 While DoIt = 1 Open "C:TempList.txt" for output as #1 Print #1, Files In Folder Close #1
Open "C:TempList.txt" for input as #2 while not eof(2) Line input #2, MyFile Display MyFile on screen Wait for 30 seconds Close MyFile and MyApplication that opened it wend Close #2
I can get the directory listing just fine with no problems
I can open the files in the associated application just fine with no problems.
with closing the application after 30 seconds or some period of time.
I need some code that will allow me to easily send it a filename and it will know how to close the file and the application that opened it.