+ Reply to Thread
Results 1 to 5 of 5

Data Sorting Macro and Worksheet

  1. #1
    Registered User
    Join Date
    09-28-2010
    Location
    Boston, MA
    MS-Off Ver
    Excel 2007
    Posts
    31

    Data Sorting Macro and Worksheet

    I included the exact worksheet I am working on with dummy data in place of the real data. The intent is to take the unorganized information on Sheet1 and then populate the tabs according to the table set-up I included. I began work on the macro and can't get Case 2 to work (of course it will basically be a copy paste for all the other cases). If anyone can give me some pointers on this it would be appreciated!

    The If statement with the reverse counter and Tempmem is so that when one day has both lunch and dinner they are compiled into one row, rather than two.

    Thanks

    Edit: The final step after this information is a series of line graphs of each day of the week. I.E. A Monday graph showing all of the monday covers/averages throughout the time of the data set. This may help explain where I am headed.
    Attached Files Attached Files
    Last edited by Ascension; 11-02-2010 at 12:33 PM.

  2. #2
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,330

    Re: Data Sorting Macro and Worksheet

    Hi Ascension,

    Your data is set up perfectly to do pivot tables. You can filter your data by day or type and do all kinds of calculations with it as it is. When you want to move the data to different sheets based on day of week you are taking a step backwards. I'd suggest you spend some time looking at and working with Pivot Tables to give you the filtering and graphing you are looking for.

    See the attached that has 2 pivot tables of your data.

    hth.
    Attached Files Attached Files
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  3. #3
    Registered User
    Join Date
    09-28-2010
    Location
    Boston, MA
    MS-Off Ver
    Excel 2007
    Posts
    31

    Re: Data Sorting Macro and Worksheet

    Thanks for your fast response, I actually got to where I am through a pivot table. The issue with it is that the date field is never complete. I.E. I can't have it display DD-MM-YY or YYYY
    If the data is grouped it always spits out
    Year
    Month
    MM-DD
    MM-DD
    etc.

    I would need the pivot table to show only mondays, labled with the date, and then the four necessary columns, which I don't believe is possible (but I could be mistaken)

  4. #4
    Registered User
    Join Date
    09-28-2010
    Location
    Boston, MA
    MS-Off Ver
    Excel 2007
    Posts
    31

    Re: Data Sorting Macro and Worksheet

    This Pivot table is accomplishing the task, but still has the issue of the Month and Year headings which both breaks the data making it hard to graph, and drops the year of the observations, any advice on where to go from here?
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    09-28-2010
    Location
    Boston, MA
    MS-Off Ver
    Excel 2007
    Posts
    31

    Re: Data Sorting Macro and Worksheet

    Solved, by not even including the Date field and using the Day of Week as a filter, it spits out exactly what I want. Engineers have it right, The simple solution is always superior.

+ 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