assign cell content as file name

  I am attempting to create a macro that will save a workbook with the
file name under which I save the workbook coming from the contents of
one of the cells in the workbook. Suppose that each time the workbook
was altered, a specific cell (A1 on Sheet1 for instance) contained the
desired file name for that workbook.  It is my goal to create a macro
that automatically assigns said workbook a name based on the content of
that cell.  Any help would be most appreciated.

0
10/18/2005 3:24:55 PM
excel 39879 articles. 2 followers. Follow

1 Replies
448 Views

Similar Articles

[PageSpeed] 38

Something like???

dim myFileName as string
myfilename = "C:\temp\" & thisworkbook.worksheets("sheet1").range("a1").value
thisworkbook.saveas filename:=myfilename


You may want to look at .SaveCopyAs in VBA's help, too.


paul.sternhagen@gmail.com wrote:
> 
>   I am attempting to create a macro that will save a workbook with the
> file name under which I save the workbook coming from the contents of
> one of the cells in the workbook. Suppose that each time the workbook
> was altered, a specific cell (A1 on Sheet1 for instance) contained the
> desired file name for that workbook.  It is my goal to create a macro
> that automatically assigns said workbook a name based on the content of
> that cell.  Any help would be most appreciated.

-- 

Dave Peterson
0
petersod (12004)
10/18/2005 4:12:13 PM
Reply:

Similar Artilces:

Converting XLS file to QIF or to OFX
How do I safely and securely convert an excel file (xls) to a QIF or OFX file? "dreamchaser" wrote: > How do I safely and securely convert an excel file (xls) to a QIF or OFX file? In Excel, save the file to CSV and ustilise iCreateOFX Basic from: http://icreateofx.co.uk/Convert-CSV-to-OFX to convert the saved CSV file to OFX. ...

Wrapping text in a cell
In a single cell, suppose I want text to appear on two lines. Viz: Case One Case Two How do I do that so that I specify the wrap point? Thanks! If you are typing the data into the cell use Alt-Enter between each string to indicate where you want a line break to occur. Case One<Alt-Enter>Case Two Alt + Enter -- Lilliabeth ------------------------------------------------------------------------ Lilliabeth's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=27741 View this thread: http://www.excelforum.com/showthread.php?threadid=476428 If you...

conversion lotus 123 files to excel -- problem
I am converting lotus123 files to excel2002. One problem is that in lotus, literals are ignored when found in a cell within a formula. Excel on the other hand is not doing this and therefore causing #value errors on all the formulas where this occurs. Is there a way to handle this in excel other than manually having to change all the formulas? ...

Item assign to vendors
Would like to have the ability to mass assign items to all vendors. IE: When purchasing services such as delivery or installations. These are service items in the inventory module and are passed on to customers in the sales cycle. They can be purchased from any vendor so would like to be able to mass assign to all vendors. This is particularly an issue when integrating POs and Reciepts. Thank you. -- Christopher L. Mast, MBA Echelbarger, Himebaugh, Tamm & Co., P.C. 5136 Cascade Rd., S.E., Ste. 2A Grand Rapids, MI 49546-3728 phone 616.575.3482 fax 616.575.3481 ----------...

Locking Formulas to Cells
I don't know if I am using the correct terminology but this is what want to do: I have placed formulas in multiple columns that calculat my sales numbers for a bid. The problem I am running into is that change the bids for every person and when I clear a cell is clears th formula from it as well. Is there a way for me to clear cells withou deleting the formula I have placed inside it? I know that I can jus grab the first cell in the column and drag it down to re-load th formula in that column but I don't want to have to do that. I want th formulas permenant and the data I enter...

How do I add a hyperlink to an individual word in an Excel cell?
I am using Excel 2000 (not by choice) and I need to add a hyperlink to an individual word within the cell, not the whole cell itself. For example in the sentence "Click here or here to go to the appropriate web page." I want the words "here" to each have a separate hyperlink. Any ideas? I can manage some VBA too if necessary. Thanks, Rosalie Hi Rosalie, You can't do that in Excel. You would have to use HTML or Word or some other means. You could fake it, the entire cell would be a link, but you could after assigning the hyperlink select another...

how can I drag formulas with other cell references
example cell A1 contains formula "=stdev(a2:a7) cell a2 contains formula "=stdev(a8:a13) Is it possible to drag the formula down so that cell a3 contains "=stdev(a14:19) and cell a4 contains "=stdev(a20:a25) and so on for cells a5, a6, a7 etc. etc. Hi Bram, See http://www.mvps.org/dmcritchie/excel/snakecol.htm#snkAddr B1: =stdev(OFFSET($A$1,6*ROW()-5,0):OFFSET($A$1,6*ROW(),0)) B2: =stdev(OFFSET($A$1,6*ROW()-5,0):OFFSET($A$1,6*ROW(),0)) It was easier to test and verify using SUM instead of stdev, but the formula is same NOTE the formulas are in a different colu...

Cell Selection?
I have a colum of numbers 198 0 0 198 2 What I need, is to be able to select 3. the 198's are not going to be used in the next part of my equation. That seems simple enough, however all the numbers could be usable (not 198) and I need to use just the first three. Any ideas? One interp / way, using non-array formulas Assuming source numbers in A1 down Put In B1: =IF(COUNT($C$1:C1)>3,"",C1) In C1: =IF(ISERROR(SMALL(D:D,ROW(A1))),"", INDEX(A:A,MATCH(SMALL(D:D,ROW(A1)),D:D,0))) In D1: =IF(A1="","",IF(A1=198,"",ROW())) Select B1:D...

Formulas don't work in certain cells #2
nope, the cells are formatted as numbers. I simply cannot figure thi out. -Jorda -- kalik24 ----------------------------------------------------------------------- kalik247's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=1594 View this thread: http://www.excelforum.com/showthread.php?threadid=27423 Being formatted as numbers doesn't automatically mean they are numbers. Copy an empty cell formatted to General. Select your range of numbers and Paste Special>Add>OK>Esc Gord Dibben Excel MVP On Mon, 1 Nov 2004 11:59:46 -0600, kalik247 <kalik2...

How do I get excel files to open automatically from directories?
When I try to open excel files from the directory or from desktop I only get a blank worksheet not the file. I have to then go through File Open to get the file I want. There must be a way to have them open automatically. On Mon, 2 Jan 2006 21:22:01 -0800, Damian <Damian@discussions.microsoft.com> wrote: >When I try to open excel files from the directory or from desktop I only get >a blank worksheet not the file. I have to then go through File Open to get >the file I want. > >There must be a way to have them open automatically. Go to Tools -> Options -> Gen...

What does #REF! mean in the Name Manager
I have a 2007 workbook with 6-7 sheets. I made some changes to cell names and apparently made some mistakes. When I open the Name Manager, the last entry looks like this: Name Value Refers to Scope Comments x #REF! =#REF!$C$25 Workbook I cannot find that name anywhere. I have looked in C25 on every sheet. What does this mean? >Name Value Refers to Scope Comments > x #REF! =#REF!$C$25 Workbook #REF! means it's an invalid reference. Did you delete a sheet? If so, that's probably why you're getting those. -- Biff Micro...

Category assignment.
Is their any way to associate a category with a vendor automatically? So = say a charge came through on a visa from Giant this is a grocery store. = It would automatically put grocery as the category. In microsoft.public.money, Shason wrote: >Is their any way to associate a category with a vendor automatically? So say a charge came through on a visa from Giant this is a grocery store. It would automatically put grocery as the category. If it was "Giant Grocery", it might get it right the first time. Otherwise Money should learn by what you change the category to. ...

Odd problem with worksheets when opening file
Okay, here's the odd problem that's come up. When you double click on a excel file, excel opens up, but you can onl see the toolbars. The grid area looks like a snapshot of whatever you current background is before the file opened up. If you were showin your desktop, after the excel file opened, you'd still see your deskto in the datagrid area. If you start up a new excel file, then do the File>Open>file name, th file will open correctly. This problem happens across users here. Everyone is currently runnin office 2K. Any ideas on what causes the problem and any...

Outlook 2002 multiple file opening
In Outlook 2000, CTRL A would select all attached picture files, then Open would, in my case, open the files in Paintshop Pro. With the 2002 version I cannot find a way to do this. Any suggestions? ...

"File: send to mail recipient" not working
When users (on WinXP) select file, "send to mail recipient", no response from Outlook 2002. This occurs either when Outlook is open or closed. Problem happens when rt. clicking on .doc, .xls, .pdf's....all files. Any ideas?? Thanks!! ...

How do insert name automatically atop of each pg of doc?
Hello, How do I automatically insert name on each page of document like inserting page numbers? My professor told me not to type it in but to insert and I have not been able to do so. This is a new program for me, Word 2007. I have to submit my paper in MLA form and do not wish to lose points because for this. Thanks for your help. Click on the Insert tab of the Ribbon and then in the Header and Footer section, click on Header and make your choice from the options presented or click on the Edit Header button to get a blank header pane in which to insert the name in the...

if cell in other worksheet meets criteria, then leave blank.
I have data in worksheet A for each month, for each entity. Then I have a summary page which shows just the averages for each entity for each month. Then I need to create a master summary page which shows just the annual average for each entity, just one line per entity. My Summary page shows Jan-Dec in column A. I have a formula averaging the numbers from worksheet A. Jan-Mar is done. But the rest of the year hasn't happened yet, so April's formula results "#DIV/0!". I have already put in all the formulas for the year to be done with it. But I don'...

odd files created
Every time I open and edit an excel spreadsheet on a network share, small odd files get created. They are usually no larger than 25-40k and don't have any extensions to them. Looking at the properties page for any file, the file description says File. Anyone know what this is from or how to get rid of them? Permissions are setup correctly for me, Word files don't have this behavior. Excel 2000 SP3 Thanks, Hi Brian, A file the same size as the workbook would be created in the same directory as the workbook. The filename would be nonsensical (or appear to be random) character...

change column name from letters to numbers?
I'm importing a 3rd party CSV file into Excel and then comparing some of the contents to a printed spec. Each numbered field in the spec corresponds to a column in the work sheet. I'd like to change the column headers from letters to numbers. Is that possible? Tools-->Options, General tab. Check the R1C1 Reference Style. ******************* ~Anne Troy www.OfficeArticles.com www.MyExpertsOnline.com "Jerry" <jerry@nowhere.com> wrote in message news:OoyPef$eFHA.3048@TK2MSFTNGP12.phx.gbl... > I'm importing a 3rd party CSV file into Excel and then comparing ...

Excel Template Wizard, Very Large File Size
Background: Excel 2000. I created a spreadsheet and used the template wizard that links to an Access 2000 database. The template was later used to create one record and saved as a spreadsheet. The database also contains this one record. Spreadsheet and database work fine. Later I reduced the Access field size properties (none are larger than 150, most are less than 50). There are 35 fields. Unexpected result: The Excel spreadsheet (template) and the linked Access database are huge. The spreadsheet is 35MB and the associated Access 2000 database is 24MB. Each contains one record (a si...

insert a user's name/id
I am aware of functions like =TODAY() which will automatically insert today's date into a cell. I was wondering if something similar existed for user ID's/name. When you create a new spreadsheet it bears the name of the user who first created it in the properties. Is there a function I can put in a cell that will show the user name/id who has opened or last mondified the file (for example)? Thanks. not that i know of but you can do it with code. here is some code we use in some of our files to keep a record of who opened a file, when and how long they were in it. to add cod...

Fill cells with interpolated values
Hi What is the easiest way to fill cells with linear interpolated values ? e.g. i have value 5 in cell A1, and value 15 in cell A6. Cells A2 ... A5 should now be filles with 7, 9, 11, 13. of course, it's not a big deal to write a formula for interpolation, but maybe there is more simple way, (just by some mouse clicks....?) Biff Select the range A1:A6 with your start and stop value in their respective cells, and then do Edit / Fill / Series / Trend / Linear -- Regards Ken....................... Microsoft MVP - Excel Sys Spec - Win XP Pro / XL 97/00/02/...

Changing of range (Address) to (Cell)
Hi people I have encounter a problem with the use of range From a recorded macro, it's listed this way ActiveChart.SetSourceData Source:=Sheets("Trend").Range("A1:M2,A24:M28"), PlotBy:=xlRow And I edit it to this way ActiveChart.SetSourceData Source:=Sheets("Trend").Range("A1:M2," & Cells(StartX, StartY), Cells(LastX, LastY)), PlotBy:=xlRow And obviously VBA compiler won't let me go this easily, it happen to give an "evil-comment" on my source range, May i know how can i solve this Thank You Hi Kaiyang, Try this, assuming the...

Date & Time file was last saved
Is there away to display in a cell the date & time the file was last saved? I know you can do this in word but is it possible in Excel 2002? Here is an UDF Function DocProps(prop As String) application.volatile On Error GoTo err_value DocProps = ActiveWorkbook.BuiltinDocumentProperties(prop) Exit Function err_value: DocProps = CVErr(xlErrValue) End Function Now you can use the following formula in one of your cells: =DocProps("Last save time") Obviously, the file has to have been saved. -- HTH Bob Phillips ... looking out across Poole Harbour to ...

Extracting the month that a date refers to in another cell
In cell A1 I have the date 3/15/2003 (no formatting). In cell B1 I have the formula =year(A1). The year shows correctly as 2003. In cell C1 I have the formula =text(weekday(A1),"ddd"). The text shows as "Sat" which is correct. In cell D1 I have the formula =month(A1) which correctly shows '3'. I attempted to use =text(month(A1),"mmm") in cell D1, but it shows as "Jan". Can someone tell me what I am doing wrong? TIA, Alan =TEXT(A1,"mmm") for 3-letter month name and =TEXT(A1,"ddd") for 3-letter day name. where A1 houses a...