+ Reply to Thread
Results 1 to 3 of 3

transfer raw data to other sheets by matching hours and days

  1. #1
    Forum Contributor
    Join Date
    05-06-2004
    Posts
    117

    transfer raw data to other sheets by matching hours and days

    Greetings to all and thank you in advance for any help with my problem. In this post I am primarily looking for some reading material to see if I can crack my problem before I burden others. I am not very well versed in VBA, but I am an eager learner. Here is the problem: I have a master sheet with monthly data that includes the date, the hours of the day, the product, and the quantity. Following this master sheet I have an sheet for every day of the month. In each sheet I have the hours of the day listed in 24 rows and the names of the products on one header row. I would like to create a macro that would look at the product in the raw data and match it to the same product by date and by hour. The problem is that not all products have quantities for all the hours of the day so I can not match the product and blindly copy 24 rows. Can some one point me in the right direction and I will promise not to take anyone's time with unecessary questions. Thank you so much for your help!
    Oakman

  2. #2
    Forum Contributor
    Join Date
    11-29-2003
    Posts
    1,203
    Not sure I really understand the question.

    look at the product in the raw data
    Where is the "raw data"? How do you look at it?

    match it to the same product by date and by hour
    Looking at the master sheet? Or the daily sheets? If the daily sheets, how do you know which date a particular sheet is for? By its name or something in one of the header rows? If the master sheet, then do we care at all about the daily sheets in order to solve this problem? I think we must care about the daily sheets or you wouldn't have mentioned them.

    not all products have quantities for all the hours of the day
    In the case where there is no data for that date/time, do you want the previously populated cell or the next populated cell?

    Regardless of the answers above, I think the answer could be rather simple. You do a brute-force search. Keeping in mind that VBA can read from Excel abouy 50,000 times faster than it can write to Excel. So, do not be afraid to search row by row and column by column. Perhaps something like:

    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    05-06-2004
    Posts
    117
    Greetings MSP77079,
    Thank you for your response.
    i will try to answer your questions: In my raw data, i have apples and oranges. This is all in my master sheet.This master sheet is followed by 31spreadsheets labeled 1-31 for the day of the month. Each of this spreadsheets includes a header with apples and oranges. In column A, row 1-24 are labeled with the hours of the day. Basically, I would like to look at the raw data in my master sheet for apples by day (say 1/1/2007).I would like to take the quantities listed for each hour for that day and transfer them to my spreadsheet labeled with the day(1).However, if i only have apples in my raw data for 1/1/2007 for hours 1-7, 10, and 23; i would like to be able to match these same hours in my daily spreadsheet when i transfer my quantity of apples. The raw data does not list blanks between missing hours. Does this help at all? Would you like me to attach a spreadsheet? i will try to use your code as a starting point, it is always useful for me as a learning experience.

+ 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