+ Reply to Thread
Results 1 to 5 of 5

save .xlsx from active sheet, with sheet name, same address of current workbook

  1. #1
    Registered User
    Join Date
    10-27-2014
    Location
    Cartagena, Colombia
    MS-Off Ver
    2007
    Posts
    3

    save .xlsx from active sheet, with sheet name, same address of current workbook

    I try to save a new file .xlsx with the name of the worksheet, it works with .xls but I needed in a new version. Txs

    The code I'm using is:
    Please Login or Register  to view this content.
    Last edited by Leith Ross; 10-27-2014 at 08:54 PM. Reason: Added Code Tags

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: save .xlsx from active sheet, with sheet name, same address of current workbook

    Hello Mikeswell,

    Welcome to the Forum!

    An xls may or may not have macros. In newer versions of Excel workbooks can be saved only as xlsx if the workbook does not contain macros. If does have macros then it has to saved as xlsm.

    You will need a macro to determine if the xls workbook has macros or not, unless this is a one time save and you know if it has macros or not.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Registered User
    Join Date
    10-27-2014
    Location
    Cartagena, Colombia
    MS-Off Ver
    2007
    Posts
    3

    Re: save .xlsx from active sheet, with sheet name, same address of current workbook

    txs for your answer Leith.

  4. #4
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: save .xlsx from active sheet, with sheet name, same address of current workbook

    Hello Mikeswell,

    Did that solve your problem?

  5. #5
    Registered User
    Join Date
    10-27-2014
    Location
    Cartagena, Colombia
    MS-Off Ver
    2007
    Posts
    3

    Re: save .xlsx from active sheet, with sheet name, same address of current workbook

    yes,

    Dim fname1, fname2 As String
    ' Selefila is the row number
    ' The names were in the a different sheet (T4)than the one saved
    ' The name of the file were on different cells

    fname1 = Sheets("T4-AOPLC-1").Cells(11, 8).Value
    fname2 = Sheets("T4-AOPLC-1").Cells(selefila, 34).Value

    Sheets("T4").Copy
    ActiveWorkbook.SaveAs Filename:=fname1 & fname2, FileFormat:=xlNormal, ReadOnlyRecommended:=False, CreateBackup:=False
    ActiveWorkbook.Close 0

    Txs again Leith.

+ 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. [SOLVED] save active sheet in new workbook, naming it as cell value of active sheet
    By arkharova.s in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-18-2014, 06:16 AM
  2. Save Active Sheet to another Workbook
    By Wes28 in forum Excel General
    Replies: 5
    Last Post: 11-04-2008, 11:15 AM
  3. Save current active sheet only
    By Zyphon in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-28-2008, 05:03 AM
  4. Command button - to copy active sheet and not save current workbook
    By vjboaz in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-22-2008, 05:23 PM
  5. Save active sheet into new workbook
    By MarkN in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-01-2006, 10:10 PM

Tags for this Thread

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