+ Reply to Thread
Results 1 to 6 of 6

my code won't keep a running total Im stumped

  1. #1
    Registered User
    Join Date
    06-24-2013
    Location
    Canada
    MS-Off Ver
    Excel 2007
    Posts
    8

    my code won't keep a running total Im stumped

    I used to run a daily raffle where customers would buy numbers for $5.00 and my old code kept a running total less 5%. I changed the format of the raffle to weekly with different amounts less 5%. I now charge $2 for one ticket, $5 for three tickets, and $10 for ten tickets. But for the life of me I can't get my vba code to keep a running total. any direction would be greatly appreciated here is the code

    Please Login or Register  to view this content.
    Herbie Joseph

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: my code won't keep a running total Im stumped

    Please upload a workbook or a representative cut down copy, anonymised if necessary. It is always easier to advise if we can see your request in its context.

    Show a before and after situation with manually calculated results, explaining which information is data and which is results, and if it's not blindingly obvious how you have arrived at your results some explanatory notes as well.

    To upload a file click the Go Advanced button at the foot of your post, look underneath the post area for the Manage Attachments section and take it from there.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Registered User
    Join Date
    06-24-2013
    Location
    Canada
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: my code won't keep a running total Im stumped

    I uploaded the two workbooks but I can't find them I usually don't post on forums I just read through them, to find the answers I need
    sorry

    This is the first code I used that worked:

    PHP Code: 
    Sub cmdEnter_Click()
    Dim lRow As Long
    Dim ws 
    As Worksheet
    Set ws 
    Worksheets("Sheet1")
    Dim Running_Total As Currency
    Me
    .txtRunning_Total Format(Running_Total"Standard")
    Running_Total Me.txtRunning_Total.Value
    Me
    .txtTicket_Number txtTicket_Number.Value 1
    Me
    .txtPlayers_Name.Value txtPlayers_Name.Value
    Me
    .txtPlayers_Name.SetFocus
    lRow 
    ws.Cells(Rows.Count1).End(xlUp).Offset(11).Row

    ws
    .Cells(lRow1) = Me.txtTicket_Number.Text
    ws
    .Cells(lRow2) = Me.txtPlayers_Name.Text

    Me
    .txtRunning_Total.Value Me.txtTicket_Number.Value 4.75


    'Clear the data
    '
    Me.txtTicket_Number.Value ""
    Me.txtPlayers_Name.Value ""



    End Sub 
    Last edited by fampad; 09-16-2019 at 01:37 PM.

  4. #4
    Registered User
    Join Date
    06-24-2013
    Location
    Canada
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: my code won't keep a running total Im stumped

    Here are the two workbooks the daily draw works good but I cant get the weekly draw to keep a running total

    Hope someone can steer me in the right direction
    Attached Files Attached Files

  5. #5
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,483

    Re: my code won't keep a running total Im stumped

    It might be best to have the running total stored in the worksheet.

    Then have "txtRunning_Total" equal that cell.

  6. #6
    Registered User
    Join Date
    06-24-2013
    Location
    Canada
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: my code won't keep a running total Im stumped

    Ill try it, I've got til tomorrow at 1PM to come up with a solution thanks

+ 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: 5
    Last Post: 07-02-2018, 08:56 PM
  2. Running total after payments running total on excel
    By tmagplayr in forum Excel General
    Replies: 7
    Last Post: 09-26-2017, 02:01 PM
  3. Replies: 8
    Last Post: 07-19-2017, 12:06 PM
  4. Code for Running Total Using only 2 cells
    By navdad in forum Excel - New Users/Basics
    Replies: 4
    Last Post: 07-03-2013, 12:16 PM
  5. Establishing a formula/VBA code for Running Total
    By mrssteelerhall in forum Excel General
    Replies: 2
    Last Post: 04-17-2013, 04:03 PM
  6. Problems with code for keeping running total
    By LOTL in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-15-2013, 08:50 AM
  7. Code/formula to maintain running total for annual accrual
    By Greed in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-03-2012, 10:54 AM

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