Databases Reference
In-Depth Information
The final snippet of code that executes when the “Execute” button is pushed will now be
discussed. It is in this segment of code that the mapping function parameters are calculated.
For row = 1 To rowmax
'If Dynamic Values Must be recalculated with each loop pass!
If OBDynamic.Value = True Then
'Dynamic, Recalculate Parameters for each loop pass
CVal =
Workbooks(ActiveWorkbook.Name).Worksheets(ActiveSheet.Name).
Cells(RefEdRow + row - 1, RefEdCol).Value
Call CalcWindow(CVal, RVal, IRMax, IRMin, IRange, CtrPt)
End If
curval =
Workbooks(ActiveWorkbook.Name).Worksheets(ActiveSheet.Name).
Cells(row, Asc(TextBox_Col) - 64).Value
devidl = Abs((CtrPt - curval) / (IRange / 2))
Select Case CheckBox_RCM.Value
Case True
If OBLog.Value = True Then
'Log Scale
devidl = ConvertToLog (devidl)
ColorIndex = Int((devidl) * CSRange)
Else
'Linear Scale
ColorIndex = Int((devidl) * CSRange)
End If
Case False
If OBLog.Value = True Then
'Log Scale
devidl = ConvertToLog (devidl)
ColorIndex = Int(devidl * CSRange)
Else
'Linear Scale
ColorIndex = Int(devidl * CSRange)
End If
End Select
If ColorIndex < 1 Then ColorIndex = 1
If curval <= IRMax And curval >= IRMin Then
Workbooks(ActiveWorkbook.Name).Worksheets(ActiveSheet.Name).
Cells(row, Asc(TextBox_Col) - 64).Font.Color =
ColorRange(ColorIndex)
'Debug.Print row, curval, ColorIndex, CSRMax,
ColorRange(ColorIndex)
Debug.Print row, OBLog.Value, ColorIndex
End If
Next row
Search WWH ::




Custom Search