Results 1 to 3 of 3

Automatically Trigger Event when Cell Changes

Threaded View

  1. #1
    Registered User
    Join Date
    05-29-2013
    Location
    Texas
    MS-Off Ver
    Excel 2010
    Posts
    1

    Automatically Trigger Event when Cell Changes

    Hi, I'm trying to create a drop-down menu of sorts that is available in every page of the worksheet. I have the value of every page's drop down box linked to a hidden spreadsheet that uses a vlookup table to give a value based off of what "menu option" is chosen with the "default" option yielding a value of 0. I have the sum of all of the pages' numerical values in a cell on this spreadsheet and would like to create a macro that triggers whenever this cell (containing the sum) is not equal to 0. The cell that is going to be triggering the macro when not equal to 0 will be on the hidden page (MACRS Loans) and therefore not active. The Run Reset_menu at the bottom of the code runs a macro that changes all of the drop down boxes back to their default value after the page is changed in order to reset the macro. Below is what I have so far in VB, the macro works when manually executed but not automatically when the cell is changed. Any help would be much appreciated, Thanks!

    Private Sub Menu(ByVal Target As Range)
    If Not Application.Intersect(Target, Sheets("MACRS Loans").Range("C12").Value <> 0) Is Nothing Then
        Application.EnableEvents = False
    Select Case Sheets("MACRS Loans").Range("C12")
        Case 2
            Sheets("Home Page").Select
        Case 3
            Sheets("Taxes").Select
        Case 4
            Sheets("Loans").Select
        Case 5
            Sheets("Compounding").Select
        Case 6
            Sheets("Bonds").Select
        Case 7
            Sheets("Continuous Compounding").Select
        Case 8
            Sheets("WACC MARR & Cost of Capital").Select
        Case 9
            Sheets("Capitalized Cost").Select
        Case 10
            Sheets("Discounted Payback Period").Select
        Case 11
            Sheets("Depreciation").Select
        Case 12
            Sheets("Corporate Tax Rate").Select
        Case 13
            Sheets("MACRS-GDS").Select
        Case 14
            Sheets("Inflation").Select
        Case 15
            Sheets("Duration").Select
        Case 16
            Sheets("Home Page").Select
            Run "Clear_all"
        End Select
        Run "Reset_menu"
        Application.EnableEvents = True
        
    End If
    Application.EnableEvents = True
    End Sub
    Last edited by JBeaucaire; 06-01-2013 at 08:25 AM. Reason: Added CODE tags, as per Forum Rules. Take a moment to read the Forum Rules in the menu bar above. Thanks.

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