I have the below macro which had previously worked for me, but now I am getting a runtime error. I tried troubleshooting this on my own now, but am coming up with nothing.
Sub ReName_Files() Dim rFiles As Range, rCell As Range Dim StrNewName As String, strOld As String Dim strPath As String Dim wbOpen As Workbook
Application.ScreenUpdating = False
Set rFiles = Range("A1", Range("A65536").End(xlUp)) strPath = "E:FinanceUtilization Reports2008Month End"
For Each rCell In rFiles strOld = strPath & rCell StrNewName = rCell(1, 2) Set wbOpen = Workbooks.Open(strOld) wbOpen.SaveAs strPath & StrNewName wbOpen.Close Next rCell Application.ScreenUpdating = True End Sub
i'm looking for a macro which within a sheet named "foldernamedump" will list in a column the folder names within a directory I specify. I have seen a couple of sample codes but I just cant seem to get them working at all so I think its best to start from scratch and the work i get supplied here is always perfect. I also want the macro to clear the contents of the sheet before it loads again just to ensure there is no old data within the sheet.
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.
I am adding a list of file names to a combobox list and want to filter this by adding only the filenames that have been modified today. I have used the FileDateTime(Fil) but it leaves the combobox empty. I am using the code below. how to add only the files modified today.
I have sub folders with names 0001, 003A, 0032 etc in a main folder. I am using the following code to copy these sub folders name to the worksheet column A. This works well except that folder 0001 is copied as 1, 0032 as 32. How to modify the code so that 0001 is displayed in column A instaed of 1.
Private Sub Workbook_Open() Range("b3:b6500").Clear Range("c3:c6500").Clear Dim fs, F, f1, fc, s, i Range(Cells(3, 1), Cells(6500, 1)).Clear parentfolder = ThisWorkbook.Path Set fs = CreateObject("Scripting.FileSystemObject") Set F = fs.GetFolder(parentfolder) Set fc = F.SubFolders For Each f1 In fc Cells(3 + i, 1) = f1.Name i = i + 1 Next End Sub
I have a Workbook that is located in a Networked Folder and is used by several people every day. The Workbook has a lot of VBA and also has links to other workbooks. I am noticing that over time there are several extra files being created from this excel workbook, in the same folder. The Workbook is the only file in this folder. They are not associated with any program and are just a File Type. They are titled a series of 8 random Letters and Numbers and range is size from 700 KB to about 1 MB (Slightly smaller then the Workbook file size).
Also, Is possible to automatically delete these files when they are not needed? or better yet is there some way to Prevent these files from being created in the first place?
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?
i'd like to be able to import a list of file names from a folder. sounds fairly straight forward to me, but example:
folder a has 10 files in it (let's say PDFs - numbered 1 through 10). I'd like to be able to open the spread sheet, and see the file names in column b. ideally, i'd also like subfolders to be listed, in the next column. but, let's start with just this.
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
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)
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 am a complete novice with VBA and would like to write a macro that will allow me to import multiple text files stored in a folder on my directory into a single excel worksheet. I would also like the name of each text file to be output in a separate column for each row of data in the worksheet i.e. each row is 'named' with the title of the file it comes from.
The text files are comma delimited and have 5 fields e.g.