+ Reply to Thread
Results 1 to 4 of 4

SaveAs a Worksheet to another file/folder while keeping the original open/active

  1. #1
    Registered User
    Join Date
    06-24-2010
    Location
    Battle Creek, MI
    MS-Off Ver
    Excel 2007
    Posts
    84

    SaveAs a Worksheet to another file/folder while keeping the original open/active

    I have an Excel Worksheet (let's call it "AA.xlsm") which uses VBA code to loop through column A, update column B with some results/values, and then (for each value in column A) SaveAs the worksheet into a different filename/path as a ".csv" type file.

    My line of code for the SaveAs is as follows:
    Workbooks("AA.xlsm").SaveAs LEpath & CurrFldr, FileFormat:=xlCSV

    My problem is that my original worksheet, AA.xlsm, gets closed whereas I need it to stay open/active after each SaveAs iteration.

    I hope I made myself clear .... ~Dan
    Last edited by DJBittner; 04-16-2014 at 12:14 PM.

  2. #2
    Forum Expert Tinbendr's Avatar
    Join Date
    06-26-2012
    Location
    USA
    MS-Off Ver
    Office 2010
    Posts
    2,125

    Re: SaveAs a Worksheet to another file/folder while keeping the original open/active

    If you use SaveAs, you'll need to add a new workbook, move all your data you want to export to that WB, then SaveAs.

    Or you could write the data out yourself using VBA commands.
    David
    (*) Reputation points appreciated.

  3. #3
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,612

    Re: SaveAs a Worksheet to another file/folder while keeping the original open/active

    Are you trying to save one sheet out of the workbook, it's not clear?
    Please Login or Register  to view this content.
    Ben Van Johnson

  4. #4
    Registered User
    Join Date
    06-24-2010
    Location
    Battle Creek, MI
    MS-Off Ver
    Excel 2007
    Posts
    84

    Re: SaveAs a Worksheet to another file/folder while keeping the original open/active

    yes, I am saving multiple sheets out of my original workbook into a different folder path .... and your help has worked brilliantly, Thanks a ton, Dan

+ 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. Save sheet as CSV while keeping original file open?
    By gjwilson1216 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-04-2014, 02:34 PM
  2. [SOLVED] Copying Formulas Between Worksheets While Keeping Reference to Original Worksheet
    By PandaBear2014 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-04-2014, 06:32 PM
  3. [SOLVED] Open file by macro from active folder path
    By xbr088 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-26-2013, 10:11 PM
  4. [SOLVED] Macro to Import .txt file into active worksheet, keeping leading zero's
    By bwestfall in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 09-11-2012, 04:37 PM
  5. [SOLVED] Keep original wkbk open after SaveAs?
    By Ed in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-02-2005, 06:06 PM

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