I need to make this macro read FOLDER names instead of FILE names. When I posted this question yesterday to get this macro, I wasn't told that each file in its own folder. I need the folder names now. _____________________________________
Sub test() With Application.FileSearch .NewSearch .LookIn = "C:Ford" .SearchSubFolders = False .Filename = "*.*" .FileType = msoFileTypeAllFiles If .Execute() > 0 Then For i = 1 To .FoundFiles.Count Cells(i, 1) = .FoundFiles(i) Next i Else Cells(i, 1) = "No files Found" End If End With End Sub
I want to create a macro that will create a new folder called "Fungicide Quotes" under my documents and will save the workbook using the cell reference d4:f4 for the file name, which are merged cells. I have tried the following but can't get it to work. Any help would be appreciated, Thanks
Dim strFilename, strDirname, strPathname, strDefpath As String On Error Resume Next strDirname = "Fungicide Quotes"
strFilename = Range("d4:f4").Value strDefpath = "C:My Documents" If IsEmpty(Filename) Then Exit Sub
I currently use the following code to create a duplicate file based on two cells within a directory and folder i specify. These cells consist of the team and week commencing date (mondays date of week which is cell 'Main Menu'!K8)
I have a workbook that contains worksheets. They are listed as follows:
In cells A1 - A49 I have text. What I would like to do is to have a macro that I can run that will basically copy and save new workbooks with sheets A - G copied over and have the new workbook saved with the file name that I have denoted in cells A1 - A49 on Sheet 1. Also, the macro would ask me where I want to save the new Workbooks.
For example, if this were Sheet 1, Column A then the cells below would be the saved name of the new workbooks and the new workbooks would have Sheets A - G in themRed
One more piece of information, the file that is being copied and saved is large (~80MB). If there is a macro that would allow me to simply "save as' the workbook and the Saved Workbooks would be named using the data in Sheet 1, that would work as well in case copying, pasting, then saving may take more time
The code below looks at file names in column A and then goes to a folder and opens and copies the data in range c2 -lastrow from each file and pastes the data into sheet2.
how I could add to the code so that it also inserts the file name in column c?
It would make it easier to track the data in column B.
VB: Sub CopyFromFile() Dim fPath As String Dim lRow As Long
I have attached a sample workbook. The list of file name is in sheet 1. An example of the output is in sheet 2. The data in column A is dummy data generally spans 100's of rows not just 10 as in the example.
The purpose of the code is to be able to put a list of file names in column a in sheet 1 and extract data from those files in a folder. The data extraction works fine. The reson for adding the file names is so that I know what file the data came from.
I am trying to open a website, then for excel to download the csv file, then for it to save it in a specific folder under a specific name and file format (excel).
I am successful at opening the website with the following code, but how to do the rest.
Sub Searchez() Dim IE As Object Set IE = CreateObject("InternetExplorer.Application") IE.Navigate "http://quote.morningstar.ca/Quicktakes/stock/keyratios.aspx?t=clwrÂ®ion=USA&culture=en-CA&ops=clear" 'load web page google.com IE.Visible = True While IE.Busy DoEvents Wend
Is there a way to write somethign that will go to a particular folder on your computer and bring back the Names of all files in that folder?
I need to build a sheet that lists certain information from each file, which is already included in the file name - trying to avoid opening hundreds of files just to get data from one cell....for example:
I need help in creating a code which will search for files in a destination path and popluate a table to tell me if the file is present(Yes or No).
To explain I need a code which will find a specific path depending on the criteria and check if the files are present in those folders. These files will be named as todays date. Please find below the table format....
I need a macro which checks for next available number from list of filenames in a folder. Then it returns that value to one predefined cell in a new document (here Untitled.xls). For example:
has the following files: Untitled.xls - read only abc-09-001.xls abc-09-002.xls abc-09-003.xls abc-09-004.xls
Next available filename should be "abc-09-005" and macro returns that value to predefined cell in a new document (Untitled.xls). There should be NO saving at this point whatsoever. Macro simply picks the next value from a filelist. As you've noticed the value has some constants too. New document doesn't know the last picked value before macro is active (predefined cell should be empty at startup).
I have a bill of materials for each job I do, I have multiple cut sheets in one spot on the network that must be individually copied and pasted into the project file for each job. I’m hoping to automate the process. Post extraction dump from AutoCAD, my text file goes into a excel file that the information is used by multiple tabs including a bill of materials.
From the bill of materials, I want to say “if C3>0 get file 10P0044HP2.DOC” . . . I want it to get the file and save to the individual project file. .. Possible I’m not so sure. But I’m not sure of where to start.
I'm running a macro that intially opens an input box where you specify the filepath and name of a .ped file to import into the macro. The default path of H:BOM2.ped may not always be the path I use. It may be just H:.ped or H:Bom1.ped.
HTML INITIAL CHECK Response = MsgBox(".............do you want to import BOM data?", vbYesNo) Do Until Response = vbNo 'SELECT RAW FILE Dim Message, Title, Default, MyValue Message = "Please Enter PathFile Name for Source File" Title = "Create CHINA INSPECTION REPORT(s)" ' Set Title. Default = "H:BOM2.ped" ' Set Default.......
The reports I build work from a basic template with 10 or so separate, slightly different versions. In order to make them I currently update the data in the template and then click on "File>Save As..." ten times, renaming the file as appropriate.
Overall Report for yyyy/mm/dd Partner A report for yyyy/mm/dd Partner B report for yyyy/mm/dd ad nauseum..
Is there an easy macro that could save and rename my file multiple times? It would need to accept manual input for the date. Preferably it would be something that I could easily tweak to change the filenames and number of reports saved as this is most of what I do.
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 want to add the columns in the attached sheet...any 4,say A,C,D and F.....as follows,if the number in the cell is less than .8,I want use 1 in the sum,otherwise zero. I would like to do this in 1 column if possible. in the attached sheet,I have filled in manually the answer in column L....Thus row 1 contained no numbers less than .8 in the selected columns,where as row 8 had all four numbers less than .8.
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.
I recorded a macro to save a workbook to a specific folder using the current file name. However, I've tried to remove the absolute reference to a specific filename but it is not working for me. Am I close?
ActiveWorkbook.SaveAs Filename:= _ "H:Files and DocumentsPROJECTSSR 2 SS Phase Two Component ReliabilityWinTrac Files xt_conversionsexcel_version" & SheetName _ , FileFormat:=xlOpenXMLWorkbook, CreateBackup:=False
In sub which will convert file to PDF and save it to assigned folder and then attach it to email in outlook. All works fine.
However is is possible to modify the code to save fole to respective month folder ( as per current date and year)?
e.g. I have created folder Named 'Trial' in C drive . This has sub folders 2014, 2015, 2016, 2017, 2018 Each year folder will have sub-sub folders month wise like This has sub folders as Jan , Feb , Mar , Apr .... till Dec Now e.g. if date when the pdf was created is 23/4/14 then it is saved in C:Trials2014Apr automatically. Currently every year I keep creating new folders etc... bit primitive though.
Want to do something *almost* exactly like a previous post but that post is now closed. Extract Each Sheet To Text File & Save as Sheet Name .txt` I want to extract data from individual worksheets from a workbook in excel to individual text files with the **same name as the original excel file** plus incrementing suffix.
don't delete - this is not a duplicate post. Previous code 1) creates text files with "sheet name" as was the original post's intent (not "file name") and 2) it does not iterate through each sheet (only processes Sheet1 regardless of selected sheet in the workbook)
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.