help with Excel

Discussion in 'Automated Trading' started by IV_Trader, May 13, 2006.

  1. is it possible to set Conditional Alert to entry Sheet ? When cell condition=True , can Sheet1 tab change colors or start blinking ?
    TIA
     
  2. Yes, but only thru VBA (macro) code. Here you go. Down and dirty...

    Code:
    Public Sub AlertMe()
    
        Dim condition As Range
        Dim alert_this As Worksheet
    
        Set condition = Worksheets("Sheet1").Range("A1")
        Set alert_this = Worksheets("Sheet2")
    
        'NOTE: .Value must be compared based on the type of data in the cell.
        'CAVEAT... Since VBA True/False is really -1/0, the only reliable
        'compare is <> False, unless you use -1 to indicate True.
        If condition.Value <> False Then
            'index colors are found in PatternColorIndex docs.
            'or .Color = RGB(x,x,x) instead of ColorIndex.
            alert_this.Tab.ColorIndex = 5
        Else
            'ColorIndex is simplest to get "default" colorization.
            alert_this.Tab.ColorIndex = xlColorIndexNone
        End If
    
    End Sub
     
  3. O , you are my hero , thanks a lot