+ Reply to Thread
Results 1 to 5 of 5

Macro to save as using path in worksheet

  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"

    Please Login or Register  to view this content.
    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.

  2. #2
    Valued Forum Contributor
    Join Date
    05-21-2009
    Location
    Great Britain
    MS-Off Ver
    Excel 2003
    Posts
    550

    Re: Macro to save as using path in worksheet

    Try changing:
    Please Login or Register  to view this content.
    to:
    Please Login or Register  to view this content.
    I am new to the forum so this may not be filled in correctly, please let me know.
    Good post, but please put code tags around VBA code.

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

    Re: Macro to save as using path in worksheet

    HI Chippy

    Thank you for your reply.

    After changing the code I get the following error when i run the macro.

    Please Login or Register  to view this content.
    Sorry I don't have much knowledge of VBA
    Last edited by arlu1201; 04-03-2012 at 07:43 AM.

  4. #4
    Valued Forum Contributor
    Join Date
    05-21-2009
    Location
    Great Britain
    MS-Off Ver
    Excel 2003
    Posts
    550

    Re: Macro to save as using path in worksheet

    You said the existing code was working, but try removing the first comma in this line:
    Please Login or Register  to view this content.
    If no joy, what is in cell N2 on sheet NEW ORDER_? It must be a valid folder path including drive, e.g. C:\folder1\folder2

    Put:
    Please Login or Register  to view this content.
    before the SaveAs. It should give you a clue as to the reason for the error. myName must be a valid full file name, including drive letter, folder path and file name.

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

    Re: Macro to save as using path in worksheet

    Hi Chippy

    I'm really sorry I had the wrong path in cell N2, sorry for wasting your time.

    Thank you very much for your help on this it works a treat now.

    Shahid_Excel

+ 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