+ Reply to Thread
Results 1 to 5 of 5

Move tab to new workbook without predefined name

  1. #1
    Valued Forum Contributor
    Join Date
    10-10-2012
    Location
    New York
    MS-Off Ver
    Excel 2007/2010
    Posts
    337

    Move tab to new workbook without predefined name

    I have the following code

    Please Login or Register  to view this content.
    Instead of the hard-coded predefined workbook name, I want to open the SaveAs dialog box and take the name and location input by the user and continue with the code in line 5.

    Thanks for your help!
    Don't just use the answers provided for you. Try to understand how it works by reverse engineering or asking about it.

    Please mark the thread as [SOLVED] (Thread Tools->Mark thread as Solved) when answered.
    If you're happy with an answer given, please click the * under the person's name to boost their reputation.

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Move tab to new workbook without predefined name

    Why not set a reference to the workbook when you create it?
    Please Login or Register  to view this content.
    Or just copy the sheet.
    Please Login or Register  to view this content.
    If posting code please use code tags, see here.

  3. #3
    Valued Forum Contributor
    Join Date
    10-10-2012
    Location
    New York
    MS-Off Ver
    Excel 2007/2010
    Posts
    337

    Re: Move tab to new workbook without predefined name

    I'm not very familiar with coding. What I originally posted was cobbled together based off of trial and error with recording macros. It looks like the code you gave me is still making the new workbook named filename2.xlsx

  4. #4
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Move tab to new workbook without predefined name

    Craig

    I thought you wanted to do that.

    If you just want to move the sheet 'Q4 Payment File' to a new workbook all you need is this line.
    Please Login or Register  to view this content.
    When copying/moving a sheet if the destination is ommitted (Before/After) a new workbook is created.

  5. #5
    Valued Forum Contributor
    Join Date
    10-10-2012
    Location
    New York
    MS-Off Ver
    Excel 2007/2010
    Posts
    337

    Re: Move tab to new workbook without predefined name

    That is so much cleaner and simpler. I added to it to be

    Please Login or Register  to view this content.
    because I don't trust the users who I'm going to hand this sheet off to to remember that they have to save it.

    Thanks for your help!

+ 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: 1
    Last Post: 05-03-2012, 10:50 AM
  2. Cut and move data by macro (?) from one workbook to master workbook
    By esylvester in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-17-2012, 02:57 AM
  3. Create Multiple Workbooks From A Single Workbook in a predefined template
    By veejar in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 05-28-2010, 10:54 AM
  4. Move Data from One Workbook into mulitple sheets in another Workbook
    By charmingpri in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-30-2010, 01:09 AM
  5. Replies: 3
    Last Post: 10-27-2008, 08:32 AM

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