T
Tornados
Hello there!
below i added the code i'm using to run a macro when a certain value i
a specified range changes.. However i changed some things and it shoul
now not look at values but at the format (font color changes, an
becomes bold)....
However, i'm getting type mismatch errors when i replace range.value b
range.font.colorindex.... It seems logical to me i guess yet.. exce
things differently
Hope you can help out..
==========
Option Explicit
Sub Worksheet_Calculate()
Static dLastSent As Double
Static myVals As Variant
Dim iRow As Long
Dim iCol As Long
Dim myRng As Range
Dim SomethingChanged As Boolean
If dLastSent = 0 Then dLastSent = Now - TimeValue("02:00:00")
'If Now >= (dLastSent + TimeValue("02:00:00")) Then
Set myRng = Me.Range("c4:k27")
If IsEmpty(myVals) Then
myVals = myRng.Font.ColorIndex
Else
SomethingChanged = False
For iRow = LBound(myVals, 1) To UBound(myVals, 1)
For iCol = LBound(myVals, 2) To UBound(myVals, 2)
If myVals(iRow, iCol) = myRng.Cells(iRow
iCol).Font.ColorIndex Then
'do nothing--no change here
Else
SomethingChanged = True
dLastSent = Now
Call CDO_Send
Exit Sub
End If
Next iCol
Next iRow
If SomethingChanged Then
myVals = myRng.Font.ColorIndex
End If
End If
' End If
End Su
below i added the code i'm using to run a macro when a certain value i
a specified range changes.. However i changed some things and it shoul
now not look at values but at the format (font color changes, an
becomes bold)....
However, i'm getting type mismatch errors when i replace range.value b
range.font.colorindex.... It seems logical to me i guess yet.. exce
things differently

Hope you can help out..
==========
Option Explicit
Sub Worksheet_Calculate()
Static dLastSent As Double
Static myVals As Variant
Dim iRow As Long
Dim iCol As Long
Dim myRng As Range
Dim SomethingChanged As Boolean
If dLastSent = 0 Then dLastSent = Now - TimeValue("02:00:00")
'If Now >= (dLastSent + TimeValue("02:00:00")) Then
Set myRng = Me.Range("c4:k27")
If IsEmpty(myVals) Then
myVals = myRng.Font.ColorIndex
Else
SomethingChanged = False
For iRow = LBound(myVals, 1) To UBound(myVals, 1)
For iCol = LBound(myVals, 2) To UBound(myVals, 2)
If myVals(iRow, iCol) = myRng.Cells(iRow
iCol).Font.ColorIndex Then
'do nothing--no change here
Else
SomethingChanged = True
dLastSent = Now
Call CDO_Send
Exit Sub
End If
Next iCol
Next iRow
If SomethingChanged Then
myVals = myRng.Font.ColorIndex
End If
End If
' End If
End Su