+ Reply to Thread
Results 1 to 3 of 3

Why does this code not work??

  1. #1
    Registered User
    Join Date
    07-14-2004
    Posts
    22

    Why does this code not work??

    I am trying to have certain code "fire" each time a worksheet change is made. Can someone review this code and tell me why nothing happens? Please also check the code related to the calculations. I have never used code for cell calculations.

    Thanks

    Sub Worksheet_Change(ByVal Target As Excel.Range)
    If Sheets("Sheet1").Range("C46") = "Input" Then
    Sheets("Sheet1").Range("M45") = Sheets("Sheet1").Range("M46")
    Else
    If Sheets("Sheet1").Range("C46") = "$ Change from Previous Year" Then
    Sheets("Sheet1").Range("M45") = Sheets("Sheet1").Range("I45") + Sheets("Sheet1").Rante("M46")
    End If
    End Sub

  2. #2
    Registered User
    Join Date
    10-25-2004
    Posts
    88
    If Sheets("Sheet1").Range("C46") = "Input" Then
    Sheets("Sheet1").Range("M45") = Sheets("Sheet1").Range("M46")
    ElseIf Sheets("Sheet1").Range("C46") = "$ Change from Previous Year" Then
    Sheets("Sheet1").Range("M45") = Sheets("Sheet1").Range("I45") + Sheets("Sheet1").Range("M46")
    End If

  3. #3
    Registered User
    Join Date
    10-25-2004
    Posts
    88
    You didn't make provision for the case that the C45 value is neither "Input" nor "$ Change from previous year". Are you sure that you entered C45 correctly i.e same number of spaces between words and same characters in upper/lowercase?

+ 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