Worksheet_Calculate() : Worksheet Event « Excel « VBA / Excel / Access / Word

VBA / Excel / Access / Word
3.Data Type
4.Data Type Functions
5.Date Functions
7.File Path
9.Language Basics
10.Math Functions
13.String Functions
14.Windows API
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
VBA / Excel / Access / Word » Excel » Worksheet Event 
Private Sub Worksheet_Calculate()
    Select Case Range("C3").Value
        Case Is < Range("C4").Value
            SetArrow 10, msoShapeDownArrow
        Case Is > Range("C4").Value
            SetArrow 3, msoShapeUpArrow
    End Select
End Sub
Private Sub SetArrow()
    ' The following code is added to remove the prior shapes
    For Each sh In ActiveSheet.Shapes
        If sh.Name Like "*Arrow*" Then
        End If
    Next sh
    With Selection.ShapeRange
        With .Fill
            .Visible = msoTrue
            .ForeColor.SchemeColor = 2
            .Transparency = 0#
        End With
        With .Line
            .Weight = 0.75
            .DashStyle = msoLineSolid
            .Style = msoLineSingle
            .Transparency = 0#
            .Visible = msoTrue
            .ForeColor.SchemeColor = 64
            .BackColor.RGB = RGB(255255255)
        End With
    End With
End Sub

Related examples in the same category
1.Worksheet_SelectionChange(ByVal Target As Range)
2.With each range selection you make in the worksheet, the background color of the selection will turn blue.
3.Creating a Database Form From an Excel Worksheet in worksheet activate event
4.Cancel a change in Worksheet Selection Change event
5.If you want the same data to appear on other sheets but not in the same cell addresses
6.Activating Only the Used Range
7.Create a function for Excel: Is a cell formula cell
8.BeforeDoubleClick event
9.BeforeRightClick event
10.The Change event
11.Preventing data validation from being destroyed
12.changes a cell's interior color to red when it is double-clicked:
13.makes use of conditional formatting and overwrites any existing conditional formatting on the sheet.
14.Use a Change event to take what is in the cell and insert the colon for you
15.To validate user input, one possible location for the code is the SheetChange() event procedure of the Workbook object.
16.Use Event Parameters to cancel an event
17.disable the events and then reenable them at the end of the procedure:
18.Track worksheet change event
19.trace worksheet activate event
20.Worksheet Change Events
21.Monitoring a specific range for changes
22.checks each changed cell and displays a message box if the cell is within the desired range.
23.Validating data entry in Worksheet change event
24.SelectionChange event executes whenever the user makes a new selection on the worksheet.
25.The event-handler procedure for the SelectionChange event
26.Using the Change Event to Respond to Worksheet Changes
27.Examples of Activation Events
28.Example that activates cell A1 whenever the sheet is activated:
29.Some Worksheet event are executed before the associated event occurs and have a Cancel parameter that is passed by reference.
30.Enable Events
31.event procedure runs every time the worksheet recalculates
32.Change the range color in selection change event  |  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.