+ Reply to Thread
Results 1 to 2 of 2

Using Module to Break Time Elapsed into two categories based on Interval

  1. #1
    Registered User
    Join Date
    12-12-2011
    Location
    Milwaukee, Wisconsin
    MS-Off Ver
    Excel 2007
    Posts
    4

    Using Module to Break Time Elapsed into two categories based on Interval

    Hello,

    The goal of this code is to take 4 time values, timeon, timeoff, peakstart, and peakend. These are time formatted cells in excell that will vary in actual time.
    Then, I have it count how many minutes of the appliance is on during peak hours.

    The end result I am looking for is for it to output the peak hours in the cell the function is in, and the nonpeak hours in the cell one column to the right, in number form, not time.

    I keep getting a #Value, but cannot figure out why or what I am doing wrong.

    Here is the main block of code
    Please Login or Register  to view this content.
    Here is a function I call in that code.
    Please Login or Register  to view this content.
    If you could help me out, that would be great.

    Mike

  2. #2
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591

    Re: Using Module to Break Time Elapsed into two categories based on Interval

    Hi

    How about an example workbook.

    As an aside, a function should not be used to put a value into a cell. It should return a result in the cell where the function resides. If you want to actively populate a value into a cell, then you should use a sub.

    rylo

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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