Save A File Dependant On Cell Reference
May 21, 2007
i have a order form that is customer dependant. the cust name on the form is manually entered by the user within a msg box. i have specific cusotmer folders on a shared machines C drive where i would like to save these excel docs to.
i understand that the cust name must match the name of the file and there needs to be a way to save those that do not have specific folder matching what was entered as the customer name.
the overall goal is to have the file name saved as CustomerNameDeliveryDateInvoiceNumber.xls where CustName is from cell "M3", delivery date is "Q7" and InvoiceNumber is "Q1".
Sub OrderFormSave()
Dim strCustFileName As String
savefile = "\SrSharedDocsCSPSharedFILESCustomerOrderForms & strCustFileName & "
ActiveWorkbook.SaveCopyAs savefile
End Sub
View 9 Replies
ADVERTISEMENT
Mar 6, 2014
I want to save my file as a pdf based on cell reference A4.
This is what i have
[Code] ....
View 2 Replies
View Related
Jun 19, 2014
I'm trying to make a vba that would save the file with the end date that will reference to a certain cell that user selects it. Working Sheet is a name of a File, and Current Sheet is a name of the panel where user will select the date.
ActiveWorkbook.SaveAs Filename:= WorkingSheet("Control Sheet").Range("D3").Value & Format(Date, "yyyymm") & ".xlsm", FileFormat:=51
But here i seem to missing the location
And I tried this one:
ActiveWorkbook.SaveAs Filename:="X:Work2014WorkingSheet& Format(Date,"yyyymm"). & ".xlsm" _, FileFormat:=xlOpenXMLWorkbookMacroEnabled, CreateBackup:=False
but it keeps popping up as 'expected end of statement' for yyymm?
View 8 Replies
View Related
Feb 8, 2008
I'm trying to get Mac OS X Excel VBA to understand this code however the ChDir reference and the filepath seem to be causing problems. I would like to specify in the code where the file should be stored but I did try removing the filepath section altogether but to no avail.
Option Explicit
Sub SvMe()
'Saves filename as value of A1 plus the current date
Dim newFile As String, fName As String
' Don't use "/" in date, invalid syntax
fName = Range("A1").Value
'Change the date format to whatever you'd like, but make sure it's in quotes
newFile = fName & " " & Format$(Date, "mm-dd-yyyy")
' Change directory to suit your PC, including USER NAME
ChDir _
"C:Documents and Settings USER NAME Desktop"
ActiveWorkbook. SaveAs Filename:=newFile
End Sub
View 2 Replies
View Related
Mar 5, 2012
I have created a macro in excel 2010 which enable the file to save (extract) data into separate location and name. The vba code for macro is as follows: Question: How can I save this workbook with reference to the value containing in cell B2? (it is named temporary now - as defined in the code)
Sub aaa()
'
' aaa Macro
'
[Code].....
View 1 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
Nov 25, 2009
I have a multi-sheet workbook with a some raw data that I import into Excel from another system. I then perform calculations & summaries in one of 10 other sheets. In order to make it more readable, I world like put the company logo on the top of each sheet.
Is there a way to create a Input type of sheet that I put the logo in and then on each of reporting sheets do an ='Input'!location_of_logo_cell type of formula, in a similar way that I would pull data from that same sheet, like ='input'A1?. It becomes very labor intensive if I want to make changes to the logo and then copy it to every sheet.
View 2 Replies
View Related
Feb 12, 2009
I have a macros ( code inserted ) as you can see in my code the macros save the workbook in any file name you chose just by changing the any filename option.
I would like this to be changed so that it saves based on a cell reference, say i has a name in lets say B10 i would like it to save as the name in B10.
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Application.DisplayAlerts = False
Dim bk1 As Workbook
Dim bk As Workbook
Dim myfilename As String
View 9 Replies
View Related
Aug 15, 2014
I am trying to create a macro to run from a form button, within a report, to save a file to a variable file path and name depending on the date value in cell B5.
The format of B5 looks like - 13/08/2014 16:39
The file path has folders for each year in format "yyyy" with each year having sub folders for each month in format "mm".
The file name is just the date only and is formatted "dd.mm.yy" e.g. 13.08.14
I have tried the code below in various permutations but always end up with an error - Method 'SaveAs' of object '_Workbook' failed.
[Code] ......
View 3 Replies
View Related
Feb 11, 2013
Using the developer tab I inserted an Active X combo box. Under properties I referenced a 'linked cell' that I want the data to appear in. This box works great as long as I keep the sheet open. Once I save and close the workbook and re-open, that reference is lost. It shows #REF! in that field. Why does it lose the reference? I have tried to reference a cell on the same sheet as well as a cell in a different sheet and it keeps the sheet name but not the individual cell.
View 13 Replies
View Related
Feb 14, 2009
is it possible to work on a workbook lets call it 123
once macro button is pressed it opens workbook abc
then saves it as what ever is in cell a1 to a directory?
View 14 Replies
View Related
Oct 16, 2008
I am trying to create a macro which will save the file and take the file name from cell values eg if cell A1 = "488" and Cell B1= "Buyers" when saved the file name would be 488_Buyers.
Can anyone point me in the right direction?
View 7 Replies
View Related
Oct 31, 2008
I have a excel workbook witha table and a chart.
I want to make him save with the name that it will be writen in the cell A2.
View 9 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
May 6, 2009
Explanation of problem:
I have 2 files: data.xls and calculation.xls
In data.xls, I enter a value in cell A1
In calculation.xls, I go to cell B1 and enter a reference to cell A1 on file data.xls. The following formula is entered in cell B1 of calculation.xls: =[data.xls]Sheet1!$A$1
Ok so far so good. Now when I change the value in data.xls, the value is updated automatically in the calculation.xls cell. And this is done even if I first update the value in data.xls and then later open the calculation.xls file (it will ask me to update).
Now let's say I have calculation.xls closed and I am updating the data.xls file. I enter a new entry above cell A1 in data.xls. So now the contents of cell A1 are shifed down to cell A2.
When I re-open my calculation.xls file, it is still referencing cell A1 in data.xls. Is there any way for me to link it in a way so that calculation.xls would know that it now needs to reference cell A2 since that cell got shifted down?
If both files are open then it works fine. But the way this setup will work, I will not always have them both open.
Also, if I copy the contents of data.xls onto another sheet on calculation.xls and reference the cell in the same file, then of course it works. But I would like it to work the other way with the files separate.
View 9 Replies
View Related
Jan 12, 2012
I have multiple files in one folder: first.xlsx, second.xlsx, third.xlsx etc
In each of them the first cell is calle fist_indicator, second_indicator etc
In a new document i have a column A with all the names: fist, second, third
In a hidden second column i have ="="&"["&ZS(-1)&".xlsx]Tabelle1!"&"Z1S1" which gives the value of =[first.xlsx]Tabelle1!Z1S1 , =[second.xlsx]Tabelle1!Z1S1
So now when i try in column c to just say = R1C2 it gives a #NAME? error
Summarized, i have a manually filled in column A and with it i want to make another column that shows the first cell of each document (so it uses the fist colum + the other directions to show the first cell)
if i just add =[first.xlsx]Tabelle1!Z1S1 it works, but i want to be able to make this first.xlsx be changed according to the entry in column A.
View 1 Replies
View Related
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
Dec 3, 2007
Could any Excel wiz out there tell me whether the following is possible, and if so what would be the VB code to do it?
I would like a macro that will save the contents of cell A2 in a text file, with file name from cell A1, then move the cursor down to the next row, and repeat the process until reaching the last row of data.
The end result would be a stack of text files, each containing the data from a single cell in the spreadsheet.
e.g.
001.txt (containing the contents of cell A2)
002.txt (containing the contents of cell B2)
003.txt (containing the contents of cell C2)
...etc.
This is for a multi lingual dictionary so the text files would have to be unicode as well.
View 12 Replies
View Related
Mar 10, 2009
I have a file where cell A1 is the name of the file along with B1 and C1 which provide the versions and variations:-
A1 - Sales Analysis
B1 - Version 2
C1 - Variation C
Is it possible to have a macro driven off a button button which will save the file as (current path to current folder) and then Sales Analysis Version 2 Variation C
View 8 Replies
View Related
Oct 28, 2012
By using a macro is it possible to save just a cell value as a txt file?
This is part of a Forex system I am building using excel.
There will be 28 pairs and a total of 168 buttons. Each button will be assigned a cell which will hold the information for that trade.
I am looking for a macro that will save just the cell value as trade.txt
View 4 Replies
View Related
Jan 26, 2007
Is it possible to save a file with a date taken from a cell? For example:
I have an Excel file opened, in the cell A1 there is a date: 12.04.2003 (or any other date format). I want an Excel to save this document, but after I check the date of creation (modification) of the file under Windows, I want to receive the result 12.04.2004 (or any other, that was in the cell "A1" before pressing SAVE button).
I imagine, that there would have to be some external script running, that would change the system date for a moment, just after detection of pressing SAVE command.
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
May 1, 2009
When you click File>Save As, you get a save as window that shows the current file name to "Save As"
I would like to create a macro that shows the values in a couple of cells (lets use Range("A1") & Range("B2")) instead of the current file name.
View 4 Replies
View Related
Jan 4, 2008
I'm working on creating a computerised invoicing system for where I work, and right now I'm creating a Day Book file.
I want the name of the file to simply be the date which it was created, in YYYYMMDD format. However, I keep getting the error message and am not sure what has gone wrong.
Please note that in the day book template, cell F1 contains the formula
=TEXT(E1,"yyyymmdd")
which may be useful to know in the later part of the code.
from the code below?
Private Sub DayBook_Click()
Select Case MsgBox("Proceed? (Ensure that a Day Book has not already been created)", vbYesNo Or vbQuestion Or vbDefaultButton1, "Day Book Creation")
Case vbYes
Dim strName As String
'copy today's date from invoice template
Range("H4").Select
Application.CutCopyMode = False
Selection.Copy
View 3 Replies
View Related
Nov 12, 2008
I want to use a macro to open an existing file on my c drive where the reference to that file is contained in a cell.
E.g. In my sheet, the cell A1 contains the following text "C:Documents and SettingsTest". Therefore the file I want to open using a macro will be Test.xls.
However the file I wish to open (and therefore the reference text in cell A1) could change (and it could also change to be a word document) so it needs to be able to adapt when a new valid file (and document type) reference is entered into the cell.
Also, as an aside, when I want to change the file referred to in A1, the easiest way I've found is to find the file I want in windows explorer, go to properties and copy the file reference and then paste it into A1. However the reference (from the properties tab) seems to miss the ".xls" or ".doc" at the end (see above). Is this an issue? If yes, then I'm happy to manually type the .xls or .doc extension at the end.
Is there an easier way to do this?
View 10 Replies
View Related
Jul 29, 2009
I have the following (working) formula that pulls the largest value from an array in a closed workbook on a network share:
=LARGE('\pdfpcoclu2k302pd10fap2k01dist10AdminFISCAL SHAREDM806 ReportsFY 2008-2009Clarion countyJanuary 09[385-4009.xls]M-805'!$F$11:$G$41,1)
I want to be able to use a cell value within the open workbook to change the name of the referenced workbook (i.e. the 385-4009 portion of the formula) in the fromula
I have atempted to use the following:
=LARGE('\pdfpcoclu2k302pd10fap2k01dist10AdminFISCAL SHAREDM806 ReportsFY 2008-2009Clarion countyJanuary 09["'"p8"'.xls]M-805'!$F$11:$G$41,1)
but excel returns an error and highlights the following portion of the formula:
'\pdfpcoclu2k302pd10fap2k01dist10AdminFISCAL
View 2 Replies
View Related
Jan 9, 2009
I'm using a spreadsheet to assimilate data from a number of different files. Now I need to vlookup on this compiled data, but the vlookup cannot find the value because it is not looking at the value of the data in the cell, but rather the formula. How do I get vlookup to search a column by the value displayed in that cell, rather than the reference to some other file?
View 9 Replies
View Related
Nov 8, 2009
I'm trying to open a workbook using a macro, then saving the workbook that's just been opened using a cell value as the title.
This is what I have so far ... to open up the workbook and then run a macro from there .. this works fine
Sub Test1()
'
' Test1 Macro
' Macro recorded 08/11/2009 by Tracy
'
Workbooks.Open ThisWorkbook.Path & "/MultiFuel Expense.xls"
Application.Run "'MultiFuel Expense.xls'!TestSave"
End Sub
This macro is the one I'm struggling with. I need to save a copy of the workbook I just opened (currently named MultiFuel Expense) in the same directory using the cell contents of G2 as it's name with _expense on the end.
Sub TestSave()
'
' TestSave Macro
' Macro recorded 08/11/2009 by Tracy
'
ActiveWorkbook.SaveAs Filename:=ThisWorkbook.Path & "" & Range("G2") & "_expense"
End Sub
View 9 Replies
View Related
Jan 16, 2008
Trying to reference cells in a closed workbook for the first time, and am having problems. The formula in my cell is: ='H:Trial BalanceTESTING[12-07-2007.csv]12-07-2007'!$P2
At first it wouldn't work, and I always had a #REF! in that cell, but when I opened the csv file the correct value showed in the cell that has the formula. Is it not possible to have it work without me having to open the csv file as well?
View 2 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