How To Set SAVE AS File Name To Equal A1 Contents When Rename File
Oct 19, 2005
How can I set the SAVE AS file name to equal A1's cell contents? (More specifically, when I need to rename an existing open file and place my cursor in A1 and hit Save As, I need to new file name to automatically populate A1's cell contents so I don't have to retype the contents of A1.)
View 1 Replies
ADVERTISEMENT
Oct 6, 2009
I would like to be able to open a template and save the contents of cell B19 as the file name.
Can I do this so i don't have to press a button to run the macro. I have only done one macro previously and that was with the help of people on this forum so don't get to technical.
If possible I would like to be able to save it on the server X:
eportsoffender PDF's
View 10 Replies
View Related
Nov 24, 2009
I have an excel template that needs to be copied multiple times and each sheet needs be named according to a list in an excel spread sheet. I also have a formula in the template that needs the value copied instead of the formula.
I got this script from an site and tried it. It runs but I don't see any spread sheets.
strComputer = "."
Set objWMIService = GetObject ("winmgmts:\" & strComputer & "
ootcimv2")
View 9 Replies
View Related
Oct 10, 2011
VBA coding for automatically saving an excel file as another file using the current date as part of the file name together with "32ga" as a constant add-in. I also what this macro to run at a particular time of the day let say 00:20hrs. The excel file i want to save as is always open . It has data that changes every 24-hrs.
View 1 Replies
View Related
Dec 12, 2012
I have numerous spreadsheets that I need to open and unhide a sheet, that has XML data stored in cell A1. What I need to do is copy that data in cell A1 and paste it into a text document and save that as an XML file saved as the XLS workbook name with a date stamp.
I'm running into many issues, the main issue is the saving as current file name, and the formatting of the text/XML file.
Here is my current code, which doesn't reference the current file name and is just very generic. Once I get the saving as file-name correct and the formatting of the xml file correct, I will work on it a bit more.
Code:
Sub Test()
Dim Rng As Range
Dim wb As Workbook
Set Rng = Range("A1:A2")
Set wb = Workbooks.Add
With wb
Rng.Copy
[code]....
View 4 Replies
View Related
Feb 5, 2010
i want to browse a text file with 10 textual lines and rewrite the contents in the same file (starting from line number 11) from bottom to top.
View 9 Replies
View Related
Apr 30, 2009
I am trying to automatically reference the contents of another file into my main file. Basically I have one schedule that I've automatically generated in AutoCAD, and another formatted template. The AutoCAD schedule is completely unformated.
I want to include a link to the AutoCAD scheule (a *.CSV file) on my main spreadsheet and have the autoCAD schedule populate my template. I've done some reading, primarily on here, and I think I need to use either the INDIRECT() or the INDEX() function.
I can get INDIRECT() to work, but it's fairly repetitive (not overly important, but still.....). More importantly, though, the schedule file has to be open, which I would like to avoid if possible. INDEX(), I just can't figure out how to work!
View 2 Replies
View Related
Feb 5, 2014
I just found a code to copy file path and file contents. However it is copying folder path and folder contents.here is my requirement.I will specify a path, macro has to copy that file name in a particular cell, then it has to copy all its contents.
ex:
file name 1 has 3 sub files in it, file name 2 has 2 sub files in it--
column AColumn B
file name1file contents
file name1file contents
file name1file contents
file name2file contents
file name2file contents
And also i have extend this macro to write a index function. i will tell u about this. but first i need above thing I researched but I didn't find.
I need file name in a column then i need file contents in b column.
if a file has 10 file contents in a file then that file name should come 10 times in a column, and in b column all its contents.
View 14 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
Jun 4, 2009
I'm working on the following
Workbooks.Open Filename:= _
"D:CommondataIBMmainBRANCHBURG-PRODUCTS-BOM-ALUMINUM-UPDATE-" & Ucase(Format(DateAdd("y", 0, Date)), "YYYY-MM-DD")&".XLS"
ChDir "D:CommondataIBMmain"
ActiveWorkbook.SaveAs Filename:= _
"D:CommondataIBMmainBRANCHBURG-PRODUCTS-BOM-ALUMINUM-UPDATE-NAFTA.XLS", _
FileFormat:=xlNormal, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False
ActiveWindow.Close
Date: 2009-06-03
What I'm trying too do is open a file, make an exact copy and save it under a new file name.
My problem is in the date formula the day is not always the same. In the sample case it's 03 at other times the day will change.
is there a way too get this too work irregardles of what the day might be?
View 9 Replies
View Related
Apr 9, 2014
I have a spreadsheet where I want to require certain fields to be completed then I want to have that file auto emailed. I have learned that I do need to have the file saved before sending otherwise the data will not appear in the email, so with this I want to have the file temporarily saved emailed then the temp file deleted.
Here is the code I have so far but it errors on the blue text, I did change the TempFileName from = "Copy of " & wb1.Name & " " & Format(Now, "dd-mmm-yy h-mm-ss") to = [C16] & "_" & [B6] & "_" & [D6]
Private Sub CommandButton1_Click()
If Range("B6").Value = "" Or _
Range("d6").Value = "" Or _
Range("f6").Value = "" Or _
Range("E9").Value = "" Or _
[Code] ......
View 1 Replies
View Related
Jan 27, 2014
A co-worker of mine is exporting files from Quickpen as excel files, but every time he names the files with any Uppercase letters in the files name, they are automatically changing to all lower case. Even when he tries to rename the files, they will not stay with any uppercase letters....I have searched all over and cannot find a solution. If he sends ME the file, I can open it in excel and save it with any cases.
View 2 Replies
View Related
Jul 10, 2014
I have a Workbook that already has a macro in it that will generate multiple sheets based on certain criteria.
For each of these newly generated sheets (numbered 1-6 in the attached example), I need to be able save each of them to a PDF file based on a unique name contained in a certain cell (in this case, each named is referenced in cell Q1 of each sheet). As such, I should end up with 6 pdfs based on the attached sample files.
The PDFs would ideally need to be landscaped and should be just 1 page per sheet.
In my attached sample workbook, you'll notice that I have a "PracticePrint" macro that doesn't quite get the job done. One other criteria involves not printing any sheet with the characters "1010" in it (my PracticePrint macro is setup to do that, but it fails to do much else).
View 1 Replies
View Related
Mar 14, 2014
I have a macro which successully saves a worksheet as new file to another file path....(below)...but I can't figure out how to close this new file and return to the original file...
Dim myPath As String, fName As String
myPath = Sheets("Date").Range("C8").Text
fName = Sheets("Date").Range("C9").Text
Sheets("Sage CSV File").Copy
With ActiveWorkbook
.SaveAs Filename:=myPath & fName
End With'
View 2 Replies
View Related
Mar 12, 2014
How can I save worksheet from existing workbook as a new workbook with extension .xls or .xlsx depending on the version of Excel on which the original was opened and no matter the extension of original?
My code that I was trying to create all above does not work, because even if I am using Excel 2007, 2010 or 2013 it will still be saving only as .xls.
View 2 Replies
View Related
Mar 6, 2012
I want to create a macro that will select all the worksheets (names and quantity will vary) and saves the file as the current file's name but in PDF. Since I only know how to record a macro it specifies the worksheet names but I need it for various workbooks. The name will vary plus the number of tabs can go anywhere from 3 to 40.
View 9 Replies
View Related
Dec 20, 2009
How to save a file, with file- name. but the directory is to be read in worksheet "towns" in Cell1 (brussels) and filename in worksheet "names" in cell B2 (i.e. winter), so it saves to c:russelswinter.txt as a wordpad or kladblok txt file, that keeps a number, so each time we push a button "go back from worksheet names to worksheet towns" the "number" that is saved in the txt document goes up by value +1. In Flemisch, the "old" code goes as follows, and saves the number in the txt file Factuurnummer7.txt. But I want that the file name (here: FactuurNummer7) can be a variable text issue, which has to be read - as already noticed - in cell B2 (with the word WINTER). So the are 2 worksheets: towns, ans names
pad$ = Application.DefaultFilePath
'controle = Dir(pad$ + "FactuurNummer7.txt")
'If controle = "" Then GoTo EerstAanmaken
'Open pad$ + "Factuurnummer7.txt" For Input As #10
'Input #10, Nummer1
'Close #10......................
View 2 Replies
View Related
Oct 11, 2006
I presently have a macro that, when run, takes to conents of C4 and C6 and saves a new version of the file being worked on into a folder on my desktop. I love the macro with the exception of one part: I don't want to be prompted to overwrite the file if it already exists. How can I change this macro so that, when pressed, it overwrites the file without prompting the user and waiting for their answer?
Here is the current
Sub SaveIt() ...
View 3 Replies
View Related
Jun 6, 2014
My macro pulls data from a set of files in a folder and creates an output based on my formatting rules.
Ran into 2 issues though. The first being is after this macro is run it saves a file in the folder with the name "Data Export" and before I had it do this if "Data Export" was already there
Code:
'Check if file name to save exists If Dir$(vFolder & "" & sSubFolder & ".xls", vbNormal) = "" Then
wb.SaveAs vFolder & "" & sSubFolder & ".xls"
MsgBox "Complete!", vbOKOnly
Else
MsgBox "File already exists, could not save!", vbInformation, "COMPLETE!"
End If
What I want it to do instead is change itself and save it as Data Export A, and then also loop for A each time, if A is there go to B , so on and so forth.
-Alternate solution if this is way to challenging, can I have it pop up the Save Message box to let the user try a new name if "Data Export" exists. I was trying to think through that too..
2nd Issue is when I loop the files in the folder I selected in my macro, I want it to ignore "Data Export" files. Before I just took a shortcut and had it save outside of the data folder, which was fine but now we are running on so many files a day that we need it inside the same folder for organization purposes.
That is done with the following
Code:
'Loop through files in folder sFileName = Dir$(vFolder & "")
Do Until sFileName = ""
I was thinking maybe I can add an error handler to the loop? Before Do Until? Something like this? But how I can add it into the loop?
Code:
If sFileName Like "????.?.xls" Then
View 4 Replies
View Related
Aug 3, 2014
There are two excel files abc.xlsm and xyz.xlsm enclosed. download these two excel files to your desktop. Then open abc.xlsm and run following code.
[Code]....
After running code above you will see that you have a new file in your desktop named xyz.rar. Everyhing is okey until now.
Now, delete abc.xlsm, xyz.xlsm, xyz.rar from your desktop. Then download enclosed file named klm.xlsm to your desktop. Then open klm.xlsm and run following code.
[Code] ....
After running code above why there is no klm.rar file in your desktop? Is it not possible to create a zip file running code includes same workbook? I mean why I cant zip excel file, from same excel file?
Attached Files :
klm.xlsm
xyz.xlsm
abc.xlsm
View 1 Replies
View Related
Aug 27, 2009
What I would like to do is to open an excel workbook from a bat file in dos with one arguement.
so something like
start c:lacklist.xls 2315t
Once the blacklist.xls is opened I would like to have the macro to save the excel file as a csv file ignoring all the prompts and use the argurement 2315t as the directory to save it to on the j drive ie save to j:2315tlacklist.csv. Then close the workbook and continue with the rest of the commands in the bat file.
I'm guessing I have to use GetCommandLineA to read in the arguement but I can't find anything on the net that gives a clear explanation of how to use it.
View 3 Replies
View Related
Jul 8, 2013
I just copied and modify this code; What I want is to add sumting on the file name, without changing, file path, original file name and file extension
Say : I get the file
D: DocsMemo.docx
I can paste it to the fnpath with a changed filename
C: \_Temp Memo_BPMC-0001.docx
Heres the code
[Code] .....
View 3 Replies
View Related
Jun 26, 2008
I've written most of the code that I need... the problem is that I don't know how to properly select, move and rename the pdf from excel.
I have a popup to select the file, and I know what I want it to be called, what I need is the code to move and rename a non-excel file from inside a macro.
Here is what I have so far:
Sub AttachPDF()
Dim LastName As String
Dim Street As String
Dim callDate As String
Dim FilePath As String
Dim HouseNumber As String
Dim FullFileName As String
Dim FileName As String
Dim Scan As String
Range("D32").Select
'Ask user what file they want to attach.
Scan = Application. GetOpenFilename(FileFilter:="Follow Up Scan, *.pdf", Title:="Please Choose A PDF To Attach")
If Scan <> False Then
View 5 Replies
View Related
Mar 21, 2013
I have got a master workbook and I have written macro to copy and paste data on another workbook. write a macro to save the new workbook to a file path with a file name where both file name and path are stored in master workbook sheet...
View 5 Replies
View Related
Mar 15, 2014
I am using this code for 2nd coping my file and rename it automatically......
[Code] .....
I want when i want another copy always my path should be "C: estabc.xlsm"
and
For new file in same path "C: estdef.xlsm" an input box ask for the name("def.xlsm") "what new name u want for this new file".
And I input the new name for my file and done.
View 4 Replies
View Related
Sep 24, 2009
I've found these functions to assist in renaming a file.
However, I'm not quite sure how to apply to code.
View 2 Replies
View Related
Oct 17, 2011
I have some code which will look for a specific file in a given location. Is it possible to use VBA to rename that file without opening/re-saving and killing the specific file?
View 8 Replies
View Related
Feb 22, 2012
I am trying to write a VBA that rename an Excel file by adding todays date at the end of the file name. For example rename the file
C:Documents est.xls to C:Documents est020221.xls 020221 is todays date
View 3 Replies
View Related
May 3, 2012
how to write a macro in excel to rename a file with a date in a cell (A1) from that file?
View 5 Replies
View Related
Jan 25, 2008
I am using the following code to rename a file that is being pumped out by another program.
Sub CopyAndDelete()
Name "C:Program FilesPATH1234567890_3.tvr" As "C:Program FilesPATHNEWNAME.tvr"
'
End Sub
The problem I have is the the file being pumped has a varible name. The nly constant is the _#.tvr. The first 10 digits are random numbers.
I have persued the "rhymn and reason" for the file name with the vendor and have been told it can not be changed and is random. The "_#.tvr" piece comes from the number of reports I have generated for the day. So I have 5 prefined reports that run each day and can recreate the _0.tvr through _4.tvr but the first 10 are random each time.
I would like for the rename to "ignore" the first 10 digits then looking at the file name.
View 9 Replies
View Related