+ Reply to Thread
Results 1 to 7 of 7

Delete Duplicate rows vb needs to run on all worksheets

  1. #1
    Registered User
    Join Date
    04-09-2009
    Location
    UK
    MS-Off Ver
    Excel 2003
    Posts
    25

    Delete Duplicate rows vb needs to run on all worksheets

    Hi i have the below code which runs on deleting duplicate code which i found in an excel manual. I am having some trouble as i want to convert the code so that it will run on all worksheets i have which are numbered such as 1,2,3,4 etc.

    This is so it makes the workbook easy maintenance for when deleting or adding worksheets which happens quite regularly.

    Thanks



    Please Login or Register  to view this content.
    Last edited by sandy.beach; 04-22-2009 at 02:03 PM. Reason: did not label as code

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Delete Duplicate rows vb needs to run on all worksheets

    You need to to edit that original post, highlight all that code, then click the CODE icon (it looks like this: #).

    It's a forum rule and makes the code easier to read on the forum.
    =========

    Meanwhile, you want this macro to run on ALL sheets, or just sheets you've labeled 1,2,3,4...etc.?

    For ALL sheets, give this a try, just wrapped your code in another loop for all the worksheets (untested without your workbook).
    Please Login or Register  to view this content.
    Last edited by JBeaucaire; 04-20-2009 at 08:23 PM.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    04-09-2009
    Location
    UK
    MS-Off Ver
    Excel 2003
    Posts
    25

    Re: Delete Duplicate rows vb needs to run on all worksheets

    thanks for that but i was after the script just working on all 1,2,3,4 etc pages.

    What i plan to do is create a button which i can click and it will run this script which will run on all pages labelled 1,2,3,4 etc.

    Just means when adding/removing pages its less admin work.

    Thanks

  4. #4
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: Delete Duplicate rows vb needs to run on all worksheets

    Hello sandy.beach,

    Which sheet names do you want to exclude?
    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!)

  5. #5
    Registered User
    Join Date
    04-09-2009
    Location
    UK
    MS-Off Ver
    Excel 2003
    Posts
    25

    Re: Delete Duplicate rows vb needs to run on all worksheets

    I wanted to exclude sheets named:

    Menu
    and
    Main
    I just can't figure out how to do it.

    Thanks

  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,259

    Re: Delete Duplicate rows vb needs to run on all worksheets

    Hello sandy.beach,

    The macro will loop through all the sheets in the workbook. I used the Select Case statement to exclude the worksheets you posted. Here is the updated macro code.
    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    04-09-2009
    Location
    UK
    MS-Off Ver
    Excel 2003
    Posts
    25

    Re: Delete Duplicate rows vb needs to run on all worksheets

    THanks for your help everyone !!!!

    I got it working with your help

+ 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