+ Reply to Thread
Results 1 to 1 of 1

Worksheet_Calculate() problem

  1. #1
    Registered User
    Join Date
    12-02-2005
    Posts
    1

    Worksheet_Calculate() problem

    I am trying to get my excel spreadsheet to count the number of times another cell changes as a result of a calculation on another worksheet in my spreadsheet. Make sense? So I have it so that it currently counts successfully but it is counting for any calculation made and I want the counter to go up only when a specific cell is calculated.

    Here is the formula I have so far:

    Private Sub Worksheet_Calculate()
    With Me.Range("B2:B3")
    If Me.Range("B2") Then
    Me.Range("G2").Value = ((Me.Range("G2").Value) + 1)
    ElseIf Me.Range("B3") Then
    Me.Range("G3").Value = ((Me.Range("g3").Value) + 1)
    Else
    End If
    End With
    End Sub

    So I want the value of G2 to go up only when B2 changes as the result of calculation. And I want G3 to go up only when B3 changes as the result of a calculation. With the code as it is now G2 goes up when B2 AND B3 change. G3 won't go up by one at all. What is wrong?
    Last edited by tp_ryhansen; 12-02-2005 at 08:44 PM. Reason: Forgot portion of the formula

+ 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