I'm trying to create a link to a folder and to insert it in a cell. The folder name is: "C:DISCO CTEMPLATES #1". I tried to copy that text and paste it into the cell. Excel recognizes that as a hyperlink but when I click the cell a message appears: "Cannot open the selected file" Could the problem be because of the "#" symbol?
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
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.
1) I'm relatively new to arrays, but what I need to do is generate a list of file names and the sheets within each one. I would like to use an array for this, but since I don't have much experience.... well....that's why I'm here. Can someone point me in the right direction?
2) And the second part of this.... I was planning on using the FileSystemObject to determine the files in a selected folder and loop through that list of files, opening each one and harvesting the required info (file name and all sheet names). Should I use the FSO or is there something built into Excel that might be better (and also limit the number of dependencies for this little "project" of mine).
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....
In Cell A1 I have a name (John Doe). In cell A2 I want the formula which will be a number total. In Cells A4:A20 I have a list of names with John being in several of them. In Cells J4:J20 I have numbers. There is data in between the name and numbers that I don't need.
So, I want A2 to search A4:A20 and everytime it sees John Doe to add the numbers that are 9 cells over (J4:J20). This is basically to show how many mistakes John has made (total). I tried =Sumproduct((A4:A20=A1), (J4:J20,1,0)). I know I am missing something or not on the right track.
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 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'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.
How can I change the text color within a cell when I am using a concatenation formula? I have the following formula;
=" Total Bonus Earned ("&TEXT(A2/VLOOKUP($A$1,PR_DB,2,False),"#0.0%")&" of 2006 Earnings):"
In the text function portion I would like to format the result in red. An example of the result of my formula I am seeking is as follows; Total Bonus Earned (10% of 2006 Earnings): Do I need to create a custom format and if so how do I call it up within the text function?
I'm trying to add code that create a hyperlink to a file in a recently created folder in the path of L:Elec Dept ProjectsRELEASED FOR CONSTRUCTION". The code below should find the newly created *BOM*.xls created and created a hyperlink in the next available row starting on row 27 and column O on my worksheet "BOM". The code currently runs with no errors, but I'm not seeing any resulting text with path / links created.
I have the following code that will open each file in a folder and run code on it. I'm trying to write code that will create a pivot table on each of the opned files...but cannot get past opening the file...
So I had built the vba code into a specific workbook so I could just drop that workbook into any folder I wanted to run code on files to and depending on the name of the file it would run different type of code. The problem has something to do with using "activesheet" for the pivot table wizard. It just doesn't like it and gives me a application 1004 error.
any way I can modify the activesheet so it will make a pivot of the newly opened file? I think what it is trying to do is make a pivot of the blank workbook that the code resides in
Sub filelooper() MyDir = ActiveWorkbook.Path ' current path Dim MyFile As String
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 want this filecopy to: 1. create a new folder in a subfolder called "/certificates". 2. name that folder the current date. ie. "/certificates/23.11.11". 3. copy the file into that folder. 4. If it's a duplicate then rename the file " - 2" or what ever the next number is.
Code: Private Sub CommandButton2_Click() Application.ScreenUpdating = False Application.DisplayAlerts = False
I have an excel database where I register cases. I have in it a button that creates a folder with and ID nr that is in column A (I create new ID nr in the next row, when I press the button it will create a folder with that ID nr and inserts a blank word document in it). We have a template that we copy to the folder (depending what type of case). The idea would be that once the template is filled in and ready to print, It would take the values from the ID nr and a reference number a few cells to the right. Is it possible to tell excel to open the word document in the folder and create a PDF version with the ID nr and reference number. (there are only 2 templates, so the macro would have to look for one of the two in the folder)
The name of the templates are: "Standard" and "Other".
I guess the best way to start maybe this would be that I select the cell with the ID nr and then press a macro button to have this done.
One thing that needs to be done, is to put a copy in the same folder and another in a second folder called "Binder" in my documents folder.
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'm looking for one macro code in order to generate the excel files and give the standard excel file names.
Example: I have one master file in the given path like C:Temp and input box required to assign the number of file option. If I declare 10 files then my master file should get 10 copies and save it the above path....
i got a workbook made by one of the members in which on clicking of a button (make sheet)---->tabs of all the data in column A is made in that sheet. but if i want to copy a specific data that is present on main sheet to all the sheets created on click of button.