+ Reply to Thread
Results 1 to 2 of 2

Save file as filename plus fieldname

  1. #1
    Registered User
    Join Date
    01-23-2005
    Posts
    40

    Save file as filename plus fieldname

    I wrote this complicated spreadsheet with macros with 5 sheets. I am not good at macro writing, but the wizard helps. On open I unprotect the fields the user has to fill in. The user manages periodically to mess up my formulas, because he keeps saving my original file with data. I don't know how he does it, but he does.

    The spreadsheet is called Joist
    I now searched and found that I can password protect the spreadsheet and make it open in read only mode. It works fine, the user can still enter data upon trying to save the spreadsheet excel prompts for file name as: copy of_Joist.

    Is it possible to write some code to make the filename a cell from the spreadsheet, in this case Input!C2 has the pour number, for example 2458, I would like to save the spreadsheet as Joist2458.

  2. #2
    Mort_Komabt
    Guest

    RE: Save file as filename plus fieldname

    Hi there,
    You could try this code

    Sub Macro1()

    Dim fileext As String
    Range("C2").Select
    fileext = ActiveCell

    ActiveWorkbook.SaveAs Filename:= _
    "C:\Joist" & fileext & ".xls", FileFormat:= _
    xlNormal, Password:="", WriteResPassword:="",
    ReadOnlyRecommended:=False _
    , CreateBackup:=False
    End Sub

    "annep" wrote:

    >
    > I wrote this complicated spreadsheet with macros with 5 sheets. I am not
    > good at macro writing, but the wizard helps. On open I unprotect the
    > fields the user has to fill in. The user manages periodically to mess
    > up my formulas, because he keeps saving my original file with data. I
    > don't know how he does it, but he does.
    >
    > The spreadsheet is called Joist
    > I now searched and found that I can password protect the spreadsheet
    > and make it open in read only mode. It works fine, the user can still
    > enter data upon trying to save the spreadsheet excel prompts for file
    > name as: copy of_Joist.
    >
    > Is it possible to write some code to make the filename a cell from the
    > spreadsheet, in this case Input!C2 has the pour number, for example
    > 2458, I would like to save the spreadsheet as Joist2458.
    >
    >
    > --
    > annep
    > ------------------------------------------------------------------------
    > annep's Profile: http://www.excelforum.com/member.php...o&userid=18851
    > View this thread: http://www.excelforum.com/showthread...hreadid=494480
    >
    >


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1