Results 1 to 5 of 5

Macro to save as using path in worksheet

Threaded View

  1. #1
    Registered User
    Join Date
    04-02-2012
    Location
    London
    MS-Off Ver
    Excel 2007
    Posts
    35

    Macro to save as using path in worksheet

    Hi

    I need some help with the below macro please.

    The macro is working fine but what I want to change is the path for saving the file. The path that I would like it saved to is in the worksheet "NEW ORDER_" cell "N2"

    Sub RENAME2()
    
       Dim strWbKill As String
       Dim myName As String
        
       myName = ThisWorkbook.Path & Application.PathSeparator 'copy to same folder that file is in
       myName = myName & Application.Cells(3, 7) & "_"  'cell G3 Style
       myName = myName & Application.Cells(3, 3) & "_"       'cell c3 Customer
       myName = myName & Application.Cells(10, 3) & "_"       'cell c10 PO Number
       myName = myName & Application.Cells(16, 4) & "_"        'cell d17 Colour
       myName = myName & Application.Cells(16, 3) & ".xlsM"    'cell c17 New/Repeat
    
        With ThisWorkbook
            strWbKill = .FullName
             ActiveWorkbook.SaveAs , Filename:=myName, FileFormat:=52
            
          End With
         
        Kill strWbKill
    
    End Sub
    I am new to the forum so this may not be filled in correctly, please let me know.

    Thank you.
    Last edited by arlu1201; 04-03-2012 at 07:43 AM. Reason: Use code tags in future. I have done it for you this time.

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