+ Reply to Thread
Results 1 to 4 of 4

Compare data on separate worksheets

  1. #1
    Registered User
    Join Date
    04-28-2008
    Posts
    4

    Compare data on separate worksheets

    Hello, I do not actually know exactly what I need to ask to get the results I am looking for so I will explain what it is I am trying.

    I have a spreadsheet with five tabs, one for each week in a month and one for an 'active week'.

    The point of this is that data is downloaded from a different system each week and put into the relevant tab. The problem with this data is that it is a cumulative total for the month thus far, and does not represent the data of any given week.

    I am trying to set up the 'active week' sheet to display the difference between the most recently downloaded data, and that of the previous week.

    The problem I am having is getting the system to identify which week is the most recent week and therefore which sheets to compare to get the data required.

    Could anyone give me an idea of the area I am looking for (if it is possible) so I can investigate further in the right direction? as I say, I don't even know the right question to ask at this point, let alone what the answer would be!

    I appreciate this post has an air of vagueness about it, but any advice would be helpful.

    Many thanks

  2. #2
    Forum Contributor stevebriz's Avatar
    Join Date
    09-07-2006
    Location
    Santiago Chile
    Posts
    389
    Can you post a saple of the workbook ...and Is it the same workbook you use for every month?
    VBA - The Power Behind the Grid

    Posting a sample of your workbook makes it easier to look at the Issue.

  3. #3
    Forum Contributor
    Join Date
    03-25-2008
    MS-Off Ver
    Excel, Outlook, Word 2007/2003
    Posts
    245
    If you current week is named 'current week' you could name the tabs of the other weeks by using some kind of date ie 20080525 for this week. So next week current week becomes 20080525. On monday you perform a new week macro to rename the current week to date-1 and reformat the tabname.

    Based on this workflow you could use the dateserial() function to loop through every worksheet of your workbook, exept the one named current week.

    Compare the datevalue of the worksheettab with a variable. The variable starts with an empty value so the first tab is higher than the variable. Store the tabname in a datevariable because tabname is higher. Go on until every worksheet is processed.

    Charlize

  4. #4
    Registered User
    Join Date
    04-28-2008
    Posts
    4
    Thank you for your quick replies, yes it is the same workbook we use every month - the data will be written over each time. Charlize I willl try what you have suggested and repost if I have any problems.

    Thanks again!

+ 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