+ Reply to Thread
Results 1 to 7 of 7

Specify which worksheets to compare

  1. #1
    Registered User
    Join Date
    05-09-2009
    Location
    Manchester,England
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    58

    Specify which worksheets to compare

    Hi Everyone,

    I have a problem and am hoping someone can help.

    I have a code that compares data between 2 sheets and populates sheet"compare" with the old and new values, I would like the macro instead of having pre-defined sheet names to be able to have an input box that the user types in which sheet they want to compare.

    I have tried to myself but I just get errors

    Can anyone assist me please

    My code is
    Please Login or Register  to view this content.
    The code then enters a formula and then I do some formatting.

    Hopefully you can see where I have tried to modify the code to include an input box

    Thanks
    Wagstaff
    Last edited by Wagstaff; 08-27-2010 at 02:13 PM. Reason: Found a solution

  2. #2
    Forum Expert Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: Specify which worksheets to compare

    This might interest you that Cheeky Charlie posted:

    http://www.excelforum.com/2357813-post36.html

    I've put together an example workbook to show how it would work.

    Hope it helps,

    Dom
    Attached Files Attached Files
    "May the fleas of a thousand camels infest the crotch of the person who screws up your day and may their arms be too short to scratch..."

    Use code tags when posting your VBA code: [code] Your code here [/code]

    Remember, saying thanks only takes a second or two. Click the little star to give some Rep if you think an answer deserves it.

  3. #3
    Forum Expert
    Join Date
    08-27-2008
    Location
    England
    MS-Off Ver
    2010
    Posts
    2,561

    Re: Specify which worksheets to compare

    Gosh that's beautiful...
    CC


    If you feel really indebted please consider a donation to charity. My preferred charity is ActionAid but there are plenty of worthy alternatives.

  4. #4
    Forum Expert Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: Specify which worksheets to compare

    See, it wasn't a waste of your time after all

    Dom

  5. #5
    Registered User
    Join Date
    05-09-2009
    Location
    Manchester,England
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    58

    Smile Re: Specify which worksheets to compare

    Thanks Dom for taking the time out to reply

    I have tried all day to try to use your suggestion but I just could not get it to work, this is more than likely due to my inexperience, however I did find a solution so I have posted below

    Please Login or Register  to view this content.

    The changes I made were

    Please Login or Register  to view this content.
    Then just changed the named worksheets to ws1 and ws2

    Thanks again
    Wagstaff

  6. #6
    Forum Expert
    Join Date
    08-27-2008
    Location
    England
    MS-Off Ver
    2010
    Posts
    2,561

    Re: Specify which worksheets to compare

    If you want to see it working, upload an example and we can show you, presume you tried the example Dom uploaded?

  7. #7
    Registered User
    Join Date
    05-09-2009
    Location
    Manchester,England
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    58

    Re: Specify which worksheets to compare

    Hi CC,

    Attached is a sample file I was working with

    When you select the first sheet "Lane 49" for the first choice, ok

    Then select the second sheet "Lane 50" for the second choice, ok

    When I then try to use the "Compare Data" button I get getting a runtime error 9, subscript out of range which highlights on this part of the code

    Please Login or Register  to view this content.
    It it because this is no longer the active sheet? As I have selected " Lane 50" with my second selection.

    If you can let me now if I have used your code correctly that would be good and also what I have done wrong.

    Thanks
    Wagstaff
    Attached Files Attached Files

+ 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