Results 1 to 2 of 2
  1. #1
    2 Star Lounger
    Join Date
    Nov 2002
    Monroeville, Pennsylvania, USA
    Thanked 0 Times in 0 Posts

    Calculate (2003)

    Using 2 cells, B1 and B2- B2 being a "total" number. How can I enter a number into B1 and have it saved in cell B2. Then add another number in B1 and add it to the number in B2. "Compounding the number" I keep getting an error msg concerning referencing the cell B2. I know this is going to happen, is there a way around this?

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Thanked 31 Times in 31 Posts

    Re: Calculate (2003)

    You could put code in the Worksheet_Change event procedure in the code module for the worksheet. Right-click the sheet tab and select View Code. Copy the following code (based on <post:=568,729>post 568,729</post:> by <!profile=sdckapr>sdckapr<!/profile>) into the module:

    Private Sub Worksheet_Change(ByVal Target As Range)
    Dim rCell As Range
    Set rCell = Intersect(Target, Range("B1"))
    If Not rCell Is Nothing Then
    Application.EnableEvents = False
    With rCell.Offset(1, 0)
    .Value = .Value + rCell.Value
    End With
    Application.EnableEvents = True
    End If
    Set rCell = Nothing
    End Sub

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts