+ Reply to Thread
Results 1 to 8 of 8

workbook.add & for each & check box IF's problems

  1. #1
    Registered User
    Join Date
    11-26-2015
    Location
    Warminster, UK
    MS-Off Ver
    2016
    Posts
    6

    workbook.add & for each & check box IF's problems

    Hi, any advice is welcome but a solution is preferred, I joke :D

    I can't seem to remove the shapes from new workbooks after they have been created???

    Please Login or Register  to view this content.
    Thanks.

  2. #2
    Registered User
    Join Date
    11-26-2015
    Location
    Warminster, UK
    MS-Off Ver
    2016
    Posts
    6

    Re: workbook.add & for each & check box IF's problems

    Sorry I should have mention I have a userform which check boxes on it, the idea is to select which 'reports' you want and then those selected get created into new, separate, workbooks. This is not a problem, but I can't then remove the shapes from the sheets that are copied into the new workbooks.

    This is a personal project to help teach myself.

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

    Re: workbook.add & for each & check box IF's problems

    Have you stepped through the code, in particular the sub resetSheet, with F8?
    If posting code please use code tags, see here.

  4. #4
    Registered User
    Join Date
    11-26-2015
    Location
    Warminster, UK
    MS-Off Ver
    2016
    Posts
    6

    Re: workbook.add & for each & check box IF's problems

    I can honestly say no. I wondering if it has something to do with which workbook is or becomes the active workbook?

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

    Re: workbook.add & for each & check box IF's problems

    If you step through the code you might find out which workbook/sheet(s) the code in the sub resetSheet is acting on.

    Another thing, it might be acting on the correct workbook/sheet(s) but might not be dealing with the 'correct' shapes/objects.

  6. #6
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229

    Re: workbook.add & for each & check box IF's problems

    Sometimes, if you change shapes data you have to force
    Please Login or Register  to view this content.
    . Try putting that line at the very end of resetSheet.
    _
    ...How to Cross-post politely...
    ..Wrap code by selecting the code and clicking the # or read this. Thank you.

  7. #7
    Registered User
    Join Date
    11-26-2015
    Location
    Warminster, UK
    MS-Off Ver
    2016
    Posts
    6

    Re: workbook.add & for each & check box IF's problems

    I had copy/paste some code so it kept activating the same workbook, lesson learned - always write the code!

  8. #8
    Registered User
    Join Date
    11-26-2015
    Location
    Warminster, UK
    MS-Off Ver
    2016
    Posts
    6

    Re: workbook.add & for each & check box IF's problems

    I've sorted it now thanks.

+ 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. Shared Workbook Problems!
    By terry27 in forum Excel General
    Replies: 0
    Last Post: 03-12-2014, 02:12 PM
  2. [SOLVED] Check for Duplications when transferring data from One Workbook to Master Workbook
    By s2jrchoi in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-18-2014, 02:52 PM
  3. updating the master workbook whenever user click submit in check workbook
    By share knowledge in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-11-2011, 10:42 PM
  4. Problems with putting a form control check box in a macro
    By tighethomas in forum Excel General
    Replies: 1
    Last Post: 08-10-2010, 05:38 PM
  5. workbook to PDF problems
    By oddjob in forum Excel General
    Replies: 2
    Last Post: 01-10-2010, 01:08 PM
  6. Help with Excel Workbook problems
    By madmikeuk in forum Excel General
    Replies: 2
    Last Post: 08-29-2006, 08:46 AM
  7. Replies: 2
    Last Post: 01-19-2006, 06:00 AM
  8. Workbook before close problems
    By st120869 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-14-2005, 09:55 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