Results 1 to 7 of 7

Macro to keep runing total problem

Threaded View

  1. #1
    Registered User
    Join Date
    03-28-2009
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    37

    Macro to keep runing total problem

    I have a macro, written by somebody else, that is designed to take a numeric value from an assigned cell, add it to the existing value in another cell and place the new total in that second cell. I needed this as a solution to the hours of overtime in a week being erased each time a new week started, but had to have a way to track the year's total. Here is an example of the code:
    For j = 8 To Cells(Rows.Count, "v").End(xlUp).Row
    Cells(j, "v") = Cells(j, "v") + Cells(j, "J")
    On Error Resume Next
    Next j
    Cell J8 is the first cell with any data in it to be added, column V (specifically cell V8) is where the yearly running total is kept. The above code works perfectly if the first cell is a number or empty; however, it gives an error - mismatch - if there is any text (other than a number) in the first cell, and only the first cell. Subsequent cells in the column with text do not give an error. Any help on how to modify this code to accept input other than a number in the first cell without giving the error?

    Thanks for any help,

    CVinje
    Last edited by CVinje; 04-17-2009 at 03:43 AM. Reason: SOLVED!! =)

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