+ Reply to Thread
Results 1 to 2 of 2

Read sheet rows and divide into hourly grouping

  1. #1
    Registered User
    Join Date
    07-09-2018
    Location
    Brisbane
    MS-Off Ver
    Excel16
    Posts
    1

    Question Read sheet rows and divide into hourly grouping

    Hi all,

    I am hoping someone can get me on track.
    I have a sheet filled with calculated data, these rows contain times and production rates for those times and each row will be for a different length of time and at a different speed.
    I am trying to read that data to a different sheet in hourly groupings for the 24hr day calculating the production rate for each hour which may be comprised of one or two or even 6 different rows and speeds.

    With this in mind I have been looking at loops inside loops and cannot seem to get my mind on track with it.

    For h = 1 To 24
    For i = 1 To noOfRows
    startTime = wsSource.Cells(4, 9).Value
    qtyPerMin = wsSource(j, 13)
    totalRequired = wsSource.Cells(j, 14)
    runtime = totalRequired / qtyPerMin
    For j = 0 To 60

    'There could be several different rows to read in here, but maybe only one.

    curCount = curCount + qtyPerMin
    Next j
    rowCount = rowCount + 1
    Next i
    Next h

    I have dabbled a bit before, probably a bit more experience with VB.NET but worked in VBA here and there so if someone can set me on the right path I should be all over it.
    I find it hard to believe someone hasn't had to do something similar at some stage but had no luck finding anything yet.

    See attached workbook for before and after examples

    Thanks in advance for any help recieved.

    hayz33
    Attached Files Attached Files
    Last edited by Hayz33; 07-09-2018 at 10:02 PM. Reason: Workbook added

  2. #2
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Read sheet rows and divide into hourly grouping

    Attach a sample workbook (not a picture or pasted copy). Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 2
    Last Post: 05-31-2018, 06:18 PM
  2. Replies: 0
    Last Post: 11-17-2015, 03:12 PM
  3. VBA Excel 2013 - Count data rows on single sheet, divide by 3 , color band rows.
    By DoodlesMama in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-26-2015, 01:33 PM
  4. Inserting rows from another sheet, appending a value, and grouping.
    By washerdryer in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-06-2012, 04:34 PM
  5. Replies: 4
    Last Post: 04-26-2007, 02:13 AM
  6. read string from database and divide result into cells?
    By ladyhawke in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 07-01-2006, 07:35 AM
  7. [SOLVED] How can I read over than 65,536 rows from excel spreed sheet
    By Lillian in forum Excel General
    Replies: 2
    Last Post: 04-15-2006, 08:50 PM

Tags for this Thread

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