+ Reply to Thread
Results 1 to 8 of 8

Modifying existing code to save worksheet

  1. #1
    Registered User
    Join Date
    12-18-2011
    Location
    New Zealand
    MS-Off Ver
    Excel 2010
    Posts
    12

    Modifying existing code to save worksheet

    I am currently using the below code to save a workbook to a designated folder, how can I modify this to save one particular sheet rather than the whole workbook? It would be sheet(3) that needs saving to the same folder.

    Please Login or Register  to view this content.

  2. #2
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,767

    Re: Modifying existing code to save worksheet

    Try this.. Untested code

    Please Login or Register  to view this content.


    If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>>
    Mark your thread as Solved


    If the suggestion helps you, then Click *below to Add Reputation

  3. #3
    Registered User
    Join Date
    12-18-2011
    Location
    New Zealand
    MS-Off Ver
    Excel 2010
    Posts
    12

    Re: Modifying existing code to save worksheet

    Thanks, works perfectly.

    Now what if I wanted to copy two seperate sheets to two different folders? Would i just replicate the code but insert

    Sheets("Sheet2").Select

    and also change

    FP = "C:\Test\" so it now reads FP="C:\Saved\"

  4. #4
    Registered User
    Join Date
    12-18-2011
    Location
    New Zealand
    MS-Off Ver
    Excel 2010
    Posts
    12

    Re: Modifying existing code to save worksheet

    Actually, think I have it sorted.

    Please Login or Register  to view this content.

    Or is there a more efficient way to do this?

  5. #5
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,767

    Re: Modifying existing code to save worksheet

    Or

    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    12-18-2011
    Location
    New Zealand
    MS-Off Ver
    Excel 2010
    Posts
    12

    Re: Modifying existing code to save worksheet

    That's great, it works perfectly.

    Have one last issue though. When I delete the data from the original workbook the info is also deleted from the newly saved sheet 3. How can I save the sheet with values only, not the formula that are linking back to the original wb?

  7. #7
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,767

    Re: Modifying existing code to save worksheet

    Try this...

    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    12-18-2011
    Location
    New Zealand
    MS-Off Ver
    Excel 2010
    Posts
    12

    Re: Modifying existing code to save worksheet

    How can I now modify this code to now save to two additional folders on a separate drive? So essentially will save to C:\Test\, C:\Saved\ and also to H:\Test\, H:\Saved\. I thought it would simply be a case of inserting the additional locations into the line:

    HTML Code: 
    so it reads:

    HTML Code: 
    But this doesn't save to the new locations, only the two first ones.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Modifying existing code
    By rhouston08 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-13-2015, 06:03 PM
  2. [SOLVED] VBA code to save current worksheet as temporary PDF file and then add to my existing code
    By brianfromla in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-20-2014, 08:35 AM
  3. [SOLVED] Add two more columns, modifying an existing VBA code help.
    By Anka in forum Excel Programming / VBA / Macros
    Replies: 23
    Last Post: 02-17-2013, 01:24 PM
  4. Modifying existing VBA code to find different file name
    By PittsburghEng in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-03-2010, 03:24 PM
  5. Help modifying existing VBA code
    By camcafe in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-28-2008, 11:02 AM

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