+ Reply to Thread
Results 1 to 6 of 6

Rearranging Data from one Table Format To Another

  1. #1
    Forum Contributor
    Join Date
    06-15-2009
    Location
    Ontario, canada
    MS-Off Ver
    Office 365
    Posts
    371

    Rearranging Data from one Table Format To Another

    Good day friends,

    I am relatively new to the skill of VBA programming, and have gained most of my knowledge from experimentation, macro recording, Google searches, and by the kind help from knowledgeable support from people like yourselves. I am applying my trial and error approach to an application I've adopted as a hobby type project and although frustrated by challenges and errors, I enjoy the learning.

    Everyonce in a while, I stumble on what I consider a major hurdle that is just too advanced for me to tackle, not only technically but logically as well. For this reason, I come seeking help and direction in helping me code for this particular complex component on my code.

    Consider my dynamic database in the attached workbook ExcelHelp.xls (worksheet("DISPATCH").Range("S6:X15"). It can contain any number of rows depending on the circumstances, and although data will always start in column S, the row number is variable. The datbase represents the times that cerain facilities are scheduled to open and close, and the staff responsible to do it.

    I need to represent this spreadsheet range textually in a "workorder", as demonstrated in range A7:I22 of the same workbook.

    Notice that records 41081003 and 41081005 are both at FacilityD and have different open and close time respecively. I've needed to combine the two, with the open information being the lesser of the two open times, and the close the greater of the close times.

    So, I humbly ask ... is this too complex to ask for help with? Is anyone up to providing some direction and support to try succeed in the automated presentation I seek?

    Jenn
    Last edited by Jenn68; 04-29-2012 at 02:45 PM.

  2. #2
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,525

    Re: Advanced Routine Exceeds My Knowledge

    try
    Please Login or Register  to view this content.
    ExcelHelpWithCode.xls

  3. #3
    Forum Contributor
    Join Date
    06-15-2009
    Location
    Ontario, canada
    MS-Off Ver
    Office 365
    Posts
    371

    Re: Advanced Routine Exceeds My Knowledge

    Hi Jindon ... please accept my sincere thanks for your support and taking the time to compile a code for me. Your generousity is appreciated.
    However, it's not producing the results I am looking for unfortunately. It could be I was unable to express my needs clearly, and if so, my apologies. Perhaps, the changes are there, but too subtle for me to pick up. As far as I could see, the result sheet in your attachment was similar to the data range in the "DISPATACH" worksheet. I'm wondering if maybe you worked opposite to what I was looking for, taking data from the destination range to compile the data as represented in my source range.

    If we refer back to my original worksheet, the worksheet is populated initially only with the data in range S6:X15 (source range). The destination range, A7:I22, is initially clear. The purpose of the code would be to populate the destination range with compiled data from the source range in the format provided in my example. For each record, their will be a line for both the facility opening, and for closing, with their respective times and staff.

    Thanks again ...

    Jenn
    Last edited by Jenn68; 04-25-2012 at 12:14 PM.

  4. #4
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,525

    Re: Advanced Routine Exceeds My Knowledge

    OK, I think I did other way around.
    try
    Please Login or Register  to view this content.

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

    Re: Advanced Routine Exceeds My Knowledge

    Hello Jenn68,

    The attached workbook has a button labeled "Schedule" that runs the macro below. The macro formats the data as you described and populates the corresponding "Work Order" columns. The latest hour is used closing when the same facility appears more than once.
    Please Login or Register  to view this content.
    Attached Files Attached Files
    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!)

  6. #6
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Advanced Routine Exceeds My Knowledge

    Jenn68,

    Your post does not comply with Rule 1 of our Forum RULES. Your post title should accurately and concisely describe your problem, not your anticipated solution. Use terms appropriate to a Google search. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will be addressed according to the OP's experience in the forum: If you have less than 10 posts, expect (and respond to) a request to change your thread title. If you have 10 or more posts, expect your post to be locked, so you can start a new thread with an appropriate title.
    To change a Title on your post, click EDIT then Go Advanced and change your title, if 2 days have passed ask a moderator to do it for you.

    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

+ 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