+ Reply to Thread
Results 1 to 4 of 4

Exporting sheet to another excel file

Hybrid View

  1. #1
    Registered User
    Join Date
    07-13-2015
    Location
    Slovakia
    MS-Off Ver
    2007, 2010, 2013
    Posts
    76

    Exporting sheet to another excel file

    Hello

    I am searching for a macro to export whole "sheet2" to an another excel file (only data, no need to copy the functions), it should automatically name the new file ( from data in certain cell) and it should have an option to select folder,where the user wants to save the file.

    Many thanks for every answer.
    Last edited by jj4jj; 07-14-2015 at 04:55 PM. Reason: better explanation

  2. #2
    Valued Forum Contributor nigelbloomy's Avatar
    Join Date
    11-06-2013
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    1,011

    Re: Exporting sheet to another excel file

    Does this get you close?
    Sub testRenameSheets()
    Dim stFileName As String
    stFileName = Selection.Value
    Worksheets("Sheet2").Copy 'Creates a new workbook with the sheet.
    With ActiveSheet.UsedRange
        .Copy
        .PasteSpecial xlValues
        .PasteSpecial xlFormats
    End With
    Application.CutCopyMode = False
    Range("A1").Select
    stFileLocation = Application.GetSaveAsFilename(InitialFileName:=stFileName)
    ActiveWorkbook.SaveAs Filename:=stFileLocation & "xlsx"
    ActiveWorkbook.Close Savechanges:=False
    End Sub
    Some people volunteer in soup kitchens or hospitals. I choose to make the world better by trying to help you with Excel. We're all learning.

    <---Click * Add Reputation for all helpful comments. It's like giving a smile.
    Forum Rules: How to mark your post [Solved] and have a happier, Excel enriched life.

  3. #3
    Registered User
    Join Date
    07-13-2015
    Location
    Slovakia
    MS-Off Ver
    2007, 2010, 2013
    Posts
    76

    Re: Exporting sheet to another excel file

    It is working brilliant...many many many thanks!!!!!

  4. #4
    Valued Forum Contributor nigelbloomy's Avatar
    Join Date
    11-06-2013
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    1,011

    Re: Exporting sheet to another excel file

    You are welcome. Thanks for the rep too.

+ 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. Replies: 5
    Last Post: 10-16-2014, 08:53 AM
  2. Exporting excel file as pdf
    By DigitalChick in forum Excel General
    Replies: 2
    Last Post: 12-18-2013, 10:17 AM
  3. Runtime Error 5 when exporting sheet as pdf file
    By Richard Buttrey in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-02-2013, 02:48 PM
  4. Consider blank cells as delimiter when exporting excel sheet to text file
    By Martijn79 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-03-2013, 07:04 AM
  5. Exporting Excel Sheet With Additional Info Added To A Text File
    By SouthernBoy718 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-12-2008, 05:51 PM
  6. [SOLVED] Exporting excel to text file
    By Exceluser in forum Excel General
    Replies: 1
    Last Post: 06-30-2005, 11:05 PM
  7. Exporting excel to text file
    By Exceluser in forum Excel General
    Replies: 1
    Last Post: 06-22-2005, 01:05 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