+ Reply to Thread
Results 1 to 5 of 5

command button: specified sheet copy and save as new workbook to specified location

  1. #1
    Registered User
    Join Date
    03-16-2011
    Location
    Belgrade, Serbia
    MS-Off Ver
    2013
    Posts
    15

    command button: specified sheet copy and save as new workbook to specified location

    Hello!

    Userform with command button:
    Current code saves copy of "active sheet", i'd like to change it to save copy of "specified sheet" to specified location.

    Private Sub cmdSaveAsNew_Click()
    ActiveSheet.Copy 'this line want to change???
    ActiveWorkbook.SaveAs "C:\Users\" & Application.UserName & "..." 'this is specified location
    End Sub

  2. #2
    Valued Forum Contributor xlbiznes's Avatar
    Join Date
    02-22-2013
    Location
    Bahrain
    MS-Off Ver
    Excel 2007
    Posts
    1,223

    Re: command button: specified sheet copy and save as new workbook to specified location

    Hi,

    put this code inside a module. The function basically requires the sheet name that you wish to copy and save. Hope this helps.

    Please Login or Register  to view this content.
    Happy Computing ,

    Xlbiznes.

    To show your appreciation please click *

  3. #3
    Registered User
    Join Date
    03-16-2011
    Location
    Belgrade, Serbia
    MS-Off Ver
    2013
    Posts
    15

    Re: command button: specified sheet copy and save as new workbook to specified location

    Hi Xlbiznes, what will triger youre code? I'd like to click cmdButton on my form to triger that code.

  4. #4
    Valued Forum Contributor xlbiznes's Avatar
    Join Date
    02-22-2013
    Location
    Bahrain
    MS-Off Ver
    Excel 2007
    Posts
    1,223

    Re: command button: specified sheet copy and save as new workbook to specified location

    Hi,

    this is the way the save will be triggered. You also need to check the file path in the save_sheet function to the target folder and file name.

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    03-16-2011
    Location
    Belgrade, Serbia
    MS-Off Ver
    2013
    Posts
    15

    Re: command button: specified sheet copy and save as new workbook to specified location

    Xlbiznes thanks, actualy this is my first time: click to call module

+ 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