+ Reply to Thread
Results 1 to 7 of 7

How to remove pages from a multipage?

  1. #1
    Registered User
    Join Date
    01-27-2011
    Location
    Brazil
    MS-Off Ver
    Excel 2007
    Posts
    75

    How to remove pages from a multipage?

    Hi, I tried something like:
    Please Login or Register  to view this content.
    but it's wrong.

    What's the right way to delete a (all) page(s)?
    Last edited by marlonsaveri; 05-25-2011 at 08:04 PM.

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: How to remove pages from a multipage?

    Either loop backwards, or

    Please Login or Register  to view this content.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Registered User
    Join Date
    01-27-2011
    Location
    Brazil
    MS-Off Ver
    Excel 2007
    Posts
    75

    Re: How to remove pages from a multipage?

    Thanks, but It also didn't run. Error 5

    nor:
    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    01-27-2011
    Location
    Brazil
    MS-Off Ver
    Excel 2007
    Posts
    75

    Re: How to remove pages from a multipage?

    Nor:
    Please Login or Register  to view this content.

  5. #5
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: How to remove pages from a multipage?

    You can only remove controls (Pages) added at run-time, not design time.

    This was wrong (my bad):

    Please Login or Register  to view this content.
    The first element of the Pages collection is 0, not 1.

  6. #6
    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: How to remove pages from a multipage?

    Hello marlonsaveri,

    Are you executing the macro from a VBA module or the UserForm?
    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!)

  7. #7
    Registered User
    Join Date
    01-27-2011
    Location
    Brazil
    MS-Off Ver
    Excel 2007
    Posts
    75

    Smile Re: How to remove pages from a multipage?

    Thanks shg and Leith (in a Userform)

    Now I think we solved the problem with:

    Please Login or Register  to view this content.
    For example, if we had 2 pages: j = 2, but, as shg said, the first one is 0. Then, g begins in 0 and goes until j-1 = 1 (del page 0 and page1)

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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