+ Reply to Thread
Results 1 to 3 of 3

Calculate current per hour rate each time a button is clicked

  1. #1
    Forum Contributor
    Join Date
    07-26-2012
    Location
    USA
    MS-Off Ver
    Excel 2007 & 2010
    Posts
    351

    Calculate current per hour rate each time a button is clicked

    I'm trying to create an area on my userform that shows how many times a button is clicked per hour. I would like the number to update on my userform every time the button is clicked. I have working code to count and display the number of times a button is clicked, but how would I go about calculating the current hourly rate each time the button is clicked? I'm guessing it would need to be some kind of estimate based upon a table I would need to create. I'm currently playing around with some code that exports the current time to a sheet each time the button is clicked. I also have a login time that records the beginning of the session on a sheet. I was thinking I could somehow manipulate these times via formulas in the spreadsheet, but I'm not sure where to begin. Any suggestions?
    Last edited by VBA FTW; 12-15-2012 at 11:36 PM.

  2. #2
    Forum Expert dredwolf's Avatar
    Join Date
    10-27-2012
    Location
    Clearwater,Canada
    MS-Off Ver
    Excel 2007
    Posts
    2,649

    Re: Calculate current per hour rate each time a button is clicked

    This sounds like a VBA/UDF solution, to count the number of events that happen, you need something to keep track of the events,....if the events get recorded in the sheet, you could use a combinatoin of IF(SUMIF(...)/COUNTIF(...)) or a SUMPRODUCT solution ,.... without some sample date to work on, this is not an easy solution

    could you upload a sample file, showing what your data looks like and what you expect as the result?
    keep any personal or confidential information out of your sample, but do have it use representative data (ie - if column A is numbers and formatted as numbers, please include in sample);
    it should also have any expected "problem" data (blank cells, mis-entered data, etc..) to make answering the problem easier..

    Add a File - click advanced (next to quick post), scroll down until you see "manage attachments", click that and select "add files" (top right corner). click "select files" find your file, select file, click "upload", click 'done" bottom right. click "submit reply"

    Hope this helps
    A picture may be worth a thousand words, BUT, a sample Workbook is worth a thousand screenshots!
    -Add a File - click advanced (next to quick post), scroll to manage attachments, click, select add files, click select files, select file, click upload, when file shows up at bottom left, click done (bottom right), click submit
    -To mark thread Solved- go top of thread,click Thread Tools,click Mark as Solved
    If you received helpful response, please remember to hit the * of that post

  3. #3
    Forum Contributor
    Join Date
    07-26-2012
    Location
    USA
    MS-Off Ver
    Excel 2007 & 2010
    Posts
    351

    Re: Calculate current per hour rate each time a button is clicked

    TestBook.xlsx

    Here is a sample WB. Everything highlighted in orange is data derived from my macro each time I click the button. Everything else is just me playing around with the numbers to try to figure out a solution

+ 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