+ Reply to Thread
Results 1 to 8 of 8

VBA to Delete Sheet Pivot

  1. #1
    Forum Contributor
    Join Date
    10-29-2012
    Location
    Laos
    MS-Off Ver
    Excel 2003,2010,2013
    Posts
    126

    VBA to Delete Sheet Pivot

    Hi All Friend & Expert,

    I would like to have VBA to Delete All sheet, except sheet " MAIN " & Sheet " CRETERIA "
    in this sample file, i have insert pivot table in sheet2 and sheet3
    then need VBA to Delete all sheet.


    Thank you in advance
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor adyteo's Avatar
    Join Date
    01-10-2013
    Location
    Calgary
    MS-Off Ver
    Excel 2010
    Posts
    540

    Re: VBA to Delete Sheet Pivot

    Please Login or Register  to view this content.
    Click on the star if you think I helped you

  3. #3
    Forum Contributor
    Join Date
    10-29-2012
    Location
    Laos
    MS-Off Ver
    Excel 2003,2010,2013
    Posts
    126

    Re: VBA to Delete Sheet Pivot

    Hi adyteo,

    I have try your code but appear like this:
    Untitled.jpg
    Attached Files Attached Files

  4. #4
    Valued Forum Contributor adyteo's Avatar
    Join Date
    01-10-2013
    Location
    Calgary
    MS-Off Ver
    Excel 2010
    Posts
    540

    Re: VBA to Delete Sheet Pivot

    It may be because of the Excel version.
    What you can do is click on Macro Recorder and then delete a sheet. Stop the Macro Recorder, press Alt-F11 and then check to see the code for deleting the sheet. Copy that code into my code and run again.

  5. #5
    Forum Contributor
    Join Date
    10-29-2012
    Location
    Laos
    MS-Off Ver
    Excel 2003,2010,2013
    Posts
    126

    Re: VBA to Delete Sheet Pivot

    it still the same, can not delete
    how to do?

  6. #6
    Forum Contributor
    Join Date
    10-29-2012
    Location
    Laos
    MS-Off Ver
    Excel 2003,2010,2013
    Posts
    126

    Re: VBA to Delete Sheet Pivot

    please help me

  7. #7
    Valued Forum Contributor adyteo's Avatar
    Join Date
    01-10-2013
    Location
    Calgary
    MS-Off Ver
    Excel 2010
    Posts
    540

    Re: VBA to Delete Sheet Pivot

    Because you have hidden sheets, you get that error. What this code does now is that if a sheet is hidden, it is not deleted, it only deletes the visible sheets.

    Please Login or Register  to view this content.

  8. #8
    Forum Contributor
    Join Date
    10-29-2012
    Location
    Laos
    MS-Off Ver
    Excel 2003,2010,2013
    Posts
    126

    Re: VBA to Delete Sheet Pivot

    Thank you so much , now it works

+ 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. [SOLVED] Copy data and sheet name to a new sheet and delete the old sheet
    By JJGF in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-01-2014, 01:31 PM
  2. multiple sheet data in 1 sheet then delete every sheet except the masterlist.
    By maria.blue44 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-13-2013, 11:48 AM
  3. [SOLVED] Copy row from sheet 1 to next row in sheet 2. delete from sheet 1 and move rows up
    By papabob1954 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 12-16-2012, 09:38 PM
  4. Replies: 5
    Last Post: 01-25-2012, 12:31 PM
  5. [SOLVED] Delete all pivot tables on a sheet
    By puff in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-07-2006, 02:10 PM

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