Saving a file by code?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • cannunzi
    New Member
    • Nov 2007
    • 6

    #1

    Saving a file by code?

    I'm trying to write code that when the file is open i hit my macro & the file name saves as cell A2 and the file saves to the folder on my network.

    where the question mark is how do i get the code to pick up number in cell A2?

    Concern is i will be opening multiple files with different file names.

    file path:
    "\\FS2\Departme nts\GOP\Tax\200 9 Compliance\Fuel Excise Tax Report 09\FuelTaxRepor ts\?
  • cannunzi
    New Member
    • Nov 2007
    • 6

    #2
    Code:
    Sub Macro3()
    '
    ' Macro3 Macro
    '
    ' Keyboard Shortcut: Ctrl+e
    '
        ChDir _
            "\\FS2\Departments\GOP\Tax\2009 Compliance\Fuel Excise Tax Report 09\FuelTaxReports"
        ActiveWorkbook.SaveAs Filename:= _
            "\\FS2\Departments\GOP\Tax\2009 Compliance\Fuel Excise Tax Report 09\FuelTaxReports\TEST.xls" _
            , FileFormat:=xlExcel8, Password:="", WriteResPassword:="", _
            ReadOnlyRecommended:=False, CreateBackup:=False
        Workbooks.Open Filename:= _
            "\\FS2\Departments\GOP\Tax\2009 Compliance\Fuel Excise Tax Report 09\FuelTaxReports\TEST.xls"
        ActiveWorkbook.SaveAs Filename:= _
            "\\FS2\Departments\GOP\Tax\2009 Compliance\Fuel Excise Tax Report 09\FuelTaxReports\[B]A2[/B]" _ How do i get the A2 to be the cell value from my file?
    
    
            , FileFormat:=xlExcel8, Password:="", WriteResPassword:="", _
            ReadOnlyRecommended:=False, CreateBackup:=False
    End Sub
    Last edited by Frinavale; Jan 7 '10, 09:26 PM. Reason: Please post code in [code] ... [/code] tags. Added code tags.

    Comment

    Working...