Closed Thread
Results 1 to 5 of 5

Help with Duplication formula please!

  1. #1
    Registered User
    Join Date
    08-30-2012
    Location
    Brisbane
    MS-Off Ver
    Excel 2007
    Posts
    14

    Help with Duplication formula please!

    Hi,

    I have this macro that does what I want it too.

    Please Login or Register  to view this content.
    Except I would like it to go through all worksheets, at the moment I change the Sheet2 part of the macro in this part to the name of the other worksheet: - "Set rng2 = Worksheets("Sheet2").Range("C:C")"

    Can anyone please tell me how I can change this to cycle through all Worksheets in the Book without me manually having to name each sheet and have it perform the same function? I have attached a sample worksheet with the macro, as you can see it only does Sheet A, I want it to do both Sheet A AND Sheet B if possible?

    Thanks!

    Sample Data.xlsm
    Last edited by JBeaucaire; 08-31-2012 at 12:16 AM. Reason: Added code tags, corrected title as per forum rules. PLEASE read the Forum Rules(link above) and follow them.

  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: Help with Duplication formula please!

    The first time through the rng1 is on sheet1 and the rng2 is on sheet2.

    What would the sheets be the second time through? The next?


    --------By the way, you know you can do this with no macro at all? You can apply Conditional Formatting to the cells in column C on the SheetA and SheetB to color themselves if they hold a value that matches a cell in column A of Sheet1?

    Here's your sheet back with that installed. Just change the Sheet1 column A values and watch the color highlights change on the other sheets.
    Attached Files Attached Files
    Last edited by JBeaucaire; 08-31-2012 at 12:23 AM.
    _________________
    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
    08-30-2012
    Location
    Brisbane
    MS-Off Ver
    Excel 2007
    Posts
    14

    Re: Help with Duplication formula please!

    Thanks for your help, I am actually going to change the macro to delete the matching row instead of colour it, so basically it will go through and automatically remove all rows that match what's in Sheet1 instead of just coloring them. Plus in the actual data file I want to do this there are 22 sheets and then multiple spreadsheets so I wouldn't want to manually do this every time, haha.

    Sheet 3, 4, 5, 6 etc would all look the same and have the same format, basically I want rng2 to not just do one sheet I want it to do all sheets except sheet1 which is my masterfile for what to delete :D



    Quote Originally Posted by JBeaucaire View Post
    The first time through the rng1 is on sheet1 and the rng2 is on sheet2.

    What would the sheets be the second time through? The next?


    --------By the way, you know you can do this with no macro at all? You can apply Conditional Formatting to the cells in column C on the SheetA and SheetB to color themselves if they hold a value that matches a cell in column A of Sheet1?

    Here's your sheet back with that installed. Just change the Sheet1 column A values and watch the color highlights change on the other sheets.

  4. #4
    Registered User
    Join Date
    08-30-2012
    Location
    Brisbane
    MS-Off Ver
    Excel 2007
    Posts
    14

    Re: Help with Duplication formula please!

    This was solved in another thread http://www.excelforum.com/excel-prog...lications.html

  5. #5
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: Help with Duplication formula please!

    Hello cstahlhut, and welcome to the forum.

    Unfortunately you have inadvertently broken one of the forum rules. Please read the following. Thanks.

    This is a duplicate post and as such does not comply with Rule 5 of our forum rules. This thread will now be closed, you may continue in your other thread.

    Thread Closed.

Closed 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