Moving Known File To Known Folder?
Sep 23, 2011
I'd like to know if there is any way to move a .wav file located in a local folder to another known local folder?
I do not need to open the file.
I'd like to use a variable for the name of the .wav file if possible. And I'd also like to use a variable for the pathname of both the original folder and the one the file is moving to. (if that makes any difference).
View 1 Replies
ADVERTISEMENT
Mar 2, 2007
I have a series of workbooks created by my salesforce (from a master template that I created for them) which they then place into a folder for me to extract data and upload that data to SAP. I am writing a procedure, therefore, to do just that.
Essentially, I would like to open the file containing the data, extract what I need and then close it. I can do that. THEN, I want to move each data file to a folder (which would depend upon the data within the file) as part of the whole procedure. I can define the new path, but I don't know how to move the book.
In creating the master template of the data files, I built into it an auto-name-creation procedure which defines the name of the file that they create. This enables me to write a procedure to work out the file to open. In order to do this, I disabled the save function (but password protected it so that I could make changes to the master template). As such, I am unable to use Save/Save As to move the data files.
View 4 Replies
View Related
May 14, 2014
I have alot of project folders on my harddrive.
All in format: I:/12345-costumer-projectname/
The five digits are unique for each project.
I make calculations for these projects using an excel file. In this excel I also type the projectnumber (cell J2)
Now i would like to make a button. When pressed, it checks the projectnumber cell J2, looksup the corresponding folder and saves the excelfile in PDF format in this folder.
I have found macro to find files in folders, but none which do the above.
View 4 Replies
View Related
Mar 15, 2013
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".
View 9 Replies
View Related
Jan 29, 2014
I need to move all the "Excel" files which are available in Folder and also the Subfolders from this location.
I need all the Excel files.
I found a code which is able to move only from Folder but not from the Subfolder.
HTML Code:
Sub Move_Certain_Files_To_New_Folder()
'This example move all Excel files from FromPath to ToPath.
'Note: It will create the folder ToPath for you with a date-time stamp
Dim FSO As Object
Dim FromPath As String
Dim ToPath As String
Dim FileExt As String
Dim FNames As String
[code].....
View 3 Replies
View Related
Aug 30, 2013
I was wondering if there is a way to write a macro that will take an excel file that I have called Alldata and then have it copy the first two sheets to a new workbook named something else( FullSparameter_0) and then copy the name of the third and fourth sheet into the new FullSparameter_0 workbook and then copy column A-E from sheet dB Alldata.xls and paste it into the FullSparameter_0.xls workbook in the same dB sheet in the same spot. And do the same thing with the Phase Sheet. i know this sounds confusing, but im really new to the VBA stuff.
I just need 15 different files from the original Alldata.xls that will be named FullSparameter_0, FullSparameter_1, .., FullSparameter_14. but each file will have the same two first sheets, Setup Information and Cal Verification, and the same last two sheet names, dB and Phase, but then in the dB and phase sheets, it will copy over the next four columns of data. so in FullSparameter_0 it will have column A-E from sheet dB in Alldata.xls in the dB sheet in FullSparameter_0 (Same with the Phase Sheets). Then in FullSparameter_1 it will have column A and Columns F,G,H and I (for dB and Phase). In fullSparameter_2 it will have column A and then J,K,L and M. Each FullSparameter_X will have the exact same first two sheets and then the other columns for the last two sheets will be pasted into columns A-E in dB and Phase.
View 1 Replies
View Related
Jul 6, 2012
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
'IE.Navigate2 "javascript:SRT_keystuts.exportcsv()"
'this is the name of the download link as from when i hover my pointer over download link.
End Sub
View 1 Replies
View Related
Jan 13, 2013
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
[Code].....
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.
View 1 Replies
View Related
Oct 9, 2012
Is there a way I can from vba cut a file from a folder and put in to another folder? And also create a folder? If yes, how can I do this?
Is it better to use dir or scripting.filesystem object?and if there is an advantage to use one over the other.
View 2 Replies
View Related
Mar 5, 2010
I have to select about 200 odd files from a folder, and move them to a different folder. The problem is, I have to manually select the 200 files from a list of approx 10,000 (not in order).
I have a list of the filenames (with extension) in an Excel Spreadsheet, and I'm wondering if there's a way to automatically move the files using an Excel macro or something?
example:
File location = C:EBDumped
and I need to move the 200 files to C:EBSent
So I would need to move ONLY the files where the file name is in the Excel list.
The file type (extension) is always the same, but the name (and length of the name) is different.
Is this possible using Windows XP with Excel XP?
View 9 Replies
View Related
Jul 24, 2009
I've created a spreadsheet that I need to share. I've created a custom menu with macros. When I copy the spreadsheet, the macros refer to the original file with an absolute path. Is it possible to copy the spreadsheet to another location and have the macros use that path?
View 9 Replies
View Related
Jan 22, 2014
I have code that has the user identify a file and then it puts that file location in a cell within the workbook
"Y:MastersProPricerENG WBS BOEXYZ.xlsx"
I want to copy a tab from the active workbook ("Resources (Spread or Load)") and move it to the workbook listed above.
View 3 Replies
View Related
Dec 17, 2008
I'm using Excel 2007, so no .filesearch
I want to search a folder for a file containing a certain phrase. Would like to use a case option like in java.
search for file containing "aaa", "bbb", "ccc", or "ddd"
then if file exists
View 14 Replies
View Related
Dec 3, 2012
I thought GetAttr did this but it returns 16 for both files and folders?
View 5 Replies
View Related
Aug 14, 2013
I have two variables one is a file name (string) the other is a folder name (long)
file name: 123478 & 123485 sept 25 2013.xlsx
folder name: 123478 & 123485
Is there a way to compare the two (in red) and if they not are similar give me a pop message.
View 2 Replies
View Related
Jul 28, 2006
I need to open all the excel file in a sub folder
(example : CCostingAccount*.*.xls)
It mean by run a macro, it will allow me to be open all excel file in the Account folder .
View 4 Replies
View Related
Apr 23, 2014
Just striving to have this kind of "picture arrangement's macro" to work, macro that whenever you choose a certain cell and operate it on hotkey it'll:
1. Create a new folder named "PicturesAuto" beside the excel file (wherever the excel file located).
2. Inside folder "picturesAuto it'll create a new subfolder named by the same name of the sheet related to that cell you operated the macro upon. (let's say this cell placed on sheet named: "happysheet"- that'll be the name of the subfolder created.)
3. Inside the subfolder "happysheet" it'll create a new subfolder named by the text of the cell you activated the macro upon (let's say you initially operated the macro on B5 cell -which has the text "montana" so it'll create "montana" subfolder also inside subfolder "happysheet")
4. Lastly instead of having only the text "montana" in "B5 cell" like we had initially before activating the macro, the macro'll also add to that text "montana" the link to "montana" folder (path of excel file->picturesAuto->happysheet->montana)
The way I'm planning to use this is to add a lot of HR pictures inside those folders created by the macro that related to that specific sheet, and that specific cell I've activated the macro upon. Plus just having those pictures so organized is just outstanding in every scale, and the excel file will keep running smoothly without any resource consuming overload.
View 7 Replies
View Related
Jun 2, 2014
I have a code that gives me path of all files inside a folder. I want to modify it.
I want to select files (individually or in group) inside a folder and then get the path. All files are .xlsx in folder.
[Code] .....
View 1 Replies
View Related
Mar 20, 2014
I have a folder that has multiple files that i would like to pull data from. This data is in the same cell in each file so all i would like to do is add the total value up at the end once it finished looping through all the files and display it on my sheet. Some of these files could have 1 worksheet where others might have 3-4. If I only have 1 file in the folder it works perfectly fine but as soon as the second file opens i get a Subscript Out of Range error (See code below for the line this error occurs on).
[Code] .......
View 6 Replies
View Related
Sep 10, 2008
All I have a macro that goes to a "Main" folder modifies the excel sheet and then saves. Is there a way to move that "Modified" sheet to the correct folder after?
All of the excel sheets are named like this:
Bldg _ Date
1130_2008-January
1200_2008-March
1300_2008-January
I need the Bldg # to be a folder.
So all of the Excel files are in this folder: C:Documents and Settingsu369875DesktopProject stuffTestin Save_AS
And then at the end of that I need the bldg Number from the front of the excel name. So for the first one : C:Documents and Settingsu369875DesktopProject stuffTestin Save_AS1130
Or I could even put that building # in the excel at lets say (A1) and grab from there if that would work..
Here is the macro I have as of now. It loops through all of the excels in the folder.
Main Macro (calls out Macro2 & Macro3)
View 14 Replies
View Related
Oct 29, 2008
I am doing a project for work at the moment where by I have to manipulate a report compiled by an external program and do various bits and bobs to it. Trouble is, the other program creates a new version every time it runs the report (i.e filename.1.xls, and the next day filename.2.xls, and so on). Is there any way of searching the folder these files are in to find the newest file and select that one as the one to open and manipulate? There will be no files other than these in the folder.
View 5 Replies
View Related
Jan 12, 2009
I have this code
View 10 Replies
View Related
Apr 30, 2009
Need code to open a browser to select a folder and list the files in that folder in excel. I do not want to include sub directories.
View 4 Replies
View Related
May 28, 2009
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:
All files are in the following folder: ....
View 11 Replies
View Related
Nov 24, 2009
I am using the code below to Open the most recent file in a folder.But once it Identifies the most recent file I get a run time error"1004"
xxxxxxxxxxxxx(name of File) could't be found.At line "Wookbooks.Open strFilename".My question is , why can't it open it, it has the location and the file name?
This code works as long as the macro and target file are in the same directory(Folder)
View 6 Replies
View Related
Sep 26, 2012
Code below is trying to search for a deal number within all file names within a set folder. There is one file in the folder with th deal number within, but it isn't finding it.
Code:
Sub Macro1()
Dim lCount As Long
Dim wbResults As Workbook
[Code]....
View 3 Replies
View Related
Mar 26, 2014
I have code that references a cell with a file path in it. If the filepath is not present I would like the folder and file to be created.
Sub Create_Path()
Dim strfolder As String
Dim filename As String
strfolder = Range("n17")
filename = Range("n16")
If Len(Dir(strfolder, vbDirectory)) = 0 Then
MkDir strfolder
End Sub
I have used this code but am getting an error at the "Mkdir strfolder" section. What do I need to change to create the file if no folder is found.
Cell N17 has the filepath
Cell N16 has what I would like to name the file as
View 4 Replies
View Related
Jun 11, 2014
I want to get source code of htm file. The files are on my folder (E:SepehrData).
The files names are like A2 [F1].htm, E2 [F4 conv].htm, E2 (DC L180G).htm and etc.
I want to bring all source code (with the tags, ) on a worksheet at column A in cell A1.
Example below.
HTML Code:
--------------------------------
<!DOCTYPE "-//DTD HTML //EN " html public>
<HTML>
<HEAD>
****** content="Vanemeze">
****** charset="ISO">
</HEAD>
<BODY>******** type="text/javascript" src="..showHide.js">
[Code] ..........
View 2 Replies
View Related
Mar 21, 2007
I'm looking to loop through a particular folder and depending on a reference contained within the file names move then to the corresponding folders and so on until the folder is empty.
I'm thinking the following can extract the reference from the filenames...
myRef = Mid(objFile.Name, Find("Ref -", objFile.Name) + 1, 5)
but I'm not sure how to hold that information (5 number reference) and then match it to a corresponding sub directory of the folder.
View 9 Replies
View Related
Nov 26, 2007
i currently have a macro on my sheet which when the file opens will chaneg a cell value by +1 and save the new worksheet as that value.
What i would like is for the new worksheet to automatically save in a new folder relevant to another cell value. So i can save the sheets in job no order.
Can't seem to get it to work....
Here is a copy of my macro so far:
Sub SequentialNumber()
Const InitialValue = 1
Const increment = 1
Const prefix = ""
Const suffix = ""
Dim existSN As Boolean
Dim existMF As Boolean
Dim master As Boolean
Dim cdp As DocumentProperty
Dim SeqNumber As Long
Dim FSName As Variant
existSN = False
existMF = False
master = False.........
View 9 Replies
View Related