Save as macro

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Logan (anonymous_at_discussions.microsoft.com)
Date: 03/10/04


Date: Wed, 10 Mar 2004 11:21:58 -0800

Here is what I've been able to workout so far but can't
find out where to insert the change directory command
I have set up a folder called 'New Files' on my 'C' drive,
this is were I would like to save them at.

Private Sub CommandButton1_Click()
Dim FName1, FName2, Fullname
FName1 = "CK0"
FName2 = Range("AU2").Value & " "
FName3 = Range("J4").Value
Fullname = FName1 & FName2 & FName3
Application.DisplayAlerts = False
    ActiveWorkbook.SaveAs Fullname, FileFormat _
        :=xlNormal, CreateBackup:=False
        MsgBox "Saved to " & CurDir
End Sub

>-----Original Message-----
>I would like to create a macro that would take the
>information from two different cells and use them as the
>file name, then save the file as an .xls in another folder.
>
>The cells I would like to use are named, Surname and
>filenumber.
>
>I am then going to create a command button on the toolbar
>so that all the employees have to do is click the 'Save As'
>button.
>
>I have no problem with creating the shortcut bottons and
>assigning the macro to it. It just that I am very new to
>VBA and not sure how to write the code, for the save as part.
>
>Any help would be appreciated
>.
>



Relevant Pages

  • Re: Disabling error checking.
    ... Then in the workbook open event, look for the cells that should ... I have an add member macro. ... > that all look up to the right folder and file. ...
    (microsoft.public.excel.programming)
  • Save as macro
    ... >find out where to insert the change directory command ... >Private Sub CommandButton1_Click ... >>information from two different cells and use them as the ... >>assigning the macro to it. ...
    (microsoft.public.excel.programming)
  • RE: Gathering data from all xl files in a folder
    ... Place the files in a different folder and try the below macro from your ... I want to monitor certain values on that report, ... import the data from a few cells an put into a different spreadsheet. ...
    (microsoft.public.excel.programming)
  • Re: Perform task on multiple sheets in a folder
    ... How could I have the folders locations selected by look at Cells A1 ... I also want the output placed a folder using the value from A3 so the ... I have saved the entire macro in a file and named the file macro1. ... >>> Dim mybook As Workbook ...
    (microsoft.public.excel.programming)
  • RE: File Save Question
    ... If strFileSvaeName = "False" Then ... The WB that contains the macro also has a hyperlink in one of the cells. ... the default file save location is the hyperlink folder. ...
    (microsoft.public.excel.programming)