+ Reply to Thread
Results 1 to 6 of 6

Macro will not create new worksheet and workbook

  1. #1
    Registered User
    Join Date
    12-18-2008
    Location
    Sydney, Australia
    Posts
    94

    Macro will not create new worksheet and workbook

    Hi there,

    Im trying to create a document that creates a new workbook when certain functions are selected and have written a macro to assist with this. Basically im working on a comprehensive checklist with all possible scenarios that will need to be tailored for use, so you can create a document with just what is applicable to you and not the whole checklist.

    I have attached a sample of what i mean, along with clearer descriptors of what the document is designed to do.

    Any help will be greatly appreciated.
    Attached Files Attached Files
    Last edited by fmluder93; 11-01-2009 at 05:09 PM.

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Macro will not create new worksheet and workbook

    The button fails to create the sheet because you are trying to copy it after Sheet12, which does not exist. It also looks for Summary Sheet(2), again this does not exist. You seem to be working with a recorded macro. This is fine, but remember such code only records what is happening. It will need editing for general us.

    Your code selects ranfges, etc which is not usually necessary in VBA.

    I've tried to edit the code for creating the new boo. You need to test it.
    Please Login or Register  to view this content.
    Last edited by royUK; 10-29-2009 at 04:11 AM.
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Registered User
    Join Date
    12-18-2008
    Location
    Sydney, Australia
    Posts
    94

    Re: Macro will not create new worksheet and workbook

    Thanks so much for your reply. Muchly muchly appreciated. I will give this a go today and let you know if it works. Cheers ...

  4. #4
    Registered User
    Join Date
    12-18-2008
    Location
    Sydney, Australia
    Posts
    94

    Re: Macro will not create new worksheet and workbook

    Hi there RoyUK. The new coding works well with the standard questions - so thank you very very much !!!!

    However, now the additional questions will not work . If i tick a box or a number of boxes (which are checkboxes with formula's) - it should continue the questions after the GREEN highlighted ones. I just get the titles and nothing more. Do i need to add more to the macro?

    I have attached the updated version with the new coding and an explanation of what i mean.

    Any help you can provide will be greatly appreciated!
    Attached Files Attached Files

  5. #5
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Macro will not create new worksheet and workbook

    make each block of questions a separate named range & hide them in the master sheet. Then use the Checkboxes to unhide them. Excel will only print the visible text.

  6. #6
    Registered User
    Join Date
    12-18-2008
    Location
    Sydney, Australia
    Posts
    94

    Re: Macro will not create new worksheet and workbook

    Works perfectly! Thanks so much RoyUK. Have an awesome day! Cheers ....

+ 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