+ Reply to Thread
Results 1 to 2 of 2

VBA calculation question

  1. #1
    Registered User
    Join Date
    11-19-2003
    Posts
    1

    VBA calculation question

    I need to total numbers for a checkbook-like spreadsheet I am creating, but I want to do it using vba and I am having a lot of problems.

    the three columns I have running are withdrawls, deposits, and balance.

    I made a userform to enter in all the info.

    I cant seem to to do a few things:

    the form allows me to go back and add entries by date in case I forgot to enter something, but then it screws up the balance column.

    I need it to subtract the first entry from a starting balance (in f1) and then from F6 down needs to calculate the balance. I tried to do it so that a withdrawl would subtract, and a deposit would add, but somehow I have it double counting things.
    I figured I would just skip the code and put formulas in the worksheets, but that got all messed up as well.

    Also, I managed to find out how to insert a row so all of the 9/15/05 entires appear before the 9/16 entries (and so on), but it always inserts the row up. I can make my code available to anyone willing to help me. It is a mess right now, 10 hours of straight coding will do that to you.

    sorry if this is hard to read, I am really out of it right now.

  2. #2
    Don Guillett
    Guest

    Re: VBA calculation question

    Perhaps you could just have your macro recalculate the entire balance using
    something like this:

    Sub balance()
    Set frng = Range("h8:h" & Range("a65536").End(xlUp).Row)
    With frng
    .Formula = "=h7+d8"
    .Formula = .Value
    End With
    End Sub
    --
    Don Guillett
    SalesAid Software
    [email protected]
    "momiage" <[email protected]> wrote in
    message news:[email protected]...
    >
    > I need to total numbers for a checkbook-like spreadsheet I am creating,
    > but I want to do it using vba and I am having a lot of problems.
    >
    > the three columns I have running are withdrawls, deposits, and
    > balance.
    >
    > I made a userform to enter in all the info.
    >
    > I cant seem to to do a few things:
    >
    > the form allows me to go back and add entries by date in case I forgot
    > to enter something, but then it screws up the balance column.
    >
    > I need it to subtract the first entry from a starting balance (in f1)
    > and then from F6 down needs to calculate the balance. I tried to do it
    > so that a withdrawl would subtract, and a deposit would add, but somehow
    > I have it double counting things.
    > I figured I would just skip the code and put formulas in the
    > worksheets, but that got all messed up as well.
    >
    > Also, I managed to find out how to insert a row so all of the 9/15/05
    > entires appear before the 9/16 entries (and so on), but it always
    > inserts the row up. I can make my code available to anyone willing to
    > help me. It is a mess right now, 10 hours of straight coding will do
    > that to you.
    >
    > sorry if this is hard to read, I am really out of it right now.
    >
    >
    > --
    > momiage
    > ------------------------------------------------------------------------
    > momiage's Profile:

    http://www.excelforum.com/member.php...fo&userid=2892
    > View this thread: http://www.excelforum.com/showthread...hreadid=466513
    >




+ 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