Databases Reference
In-Depth Information
Upon pressing the Execute button, the first task to be accomplished is to determine how many
rows are present in the column in which the mapping function is to be applied. This can be
accomplished quite simply with this line of code as discussed in earlier chapters.
rowmax = LastRowinColX(ActiveWorkbook.Name, ActiveSheet.Name,
Asc(TextBox_Col) - 64)
The next task is to create the Color Step Range (CSR) discussed earlier in this section. The
following snippets of code accomplish this:
CSRange = CreateColorRange(ColorRange())
Function CreateColorRange(ByRef ColorRange()) As Long
Dim ct As Integer 'Color Transitions
Dim sl As Integer 'Shading Level
Dim slvalue As Integer
Dim RGBCode As Long
Dim ColorIndex As Integer
Dim RC As Integer, GC As Integer, BC As Integer
If ComboBoxIColor.Text = "" Or ComboBoxFColor.Text = "" Then
MsgBox "You Must Choose and Initial and Final Color!",
vbOKOnly + vbInformation, "Required Test Parameters Not Found!"
Exit Function
End If
For ct = frm5Window.ComboBoxIColor.ListIndex + 1 To _
(frm5Window.ComboBoxFColor.ListIndex +
frm5Window.ComboBoxIColor.ListIndex + 1)
For sl = 0 To 255
CreateColorRange = CreateColorRange + 1
If Colors(ct, 5) = 0 Then
'Shading Value Decreasing
slvalue = 255 - sl
Else
'Shading Value Increasing
slvalue = sl
End If
Select Case Colors(ct, 4)
Case 1
RGBCode = RGB(slvalue, Colors(ct, 2),
Colors(ct, 3))
Case 2
RGBCode = RGB(Colors(ct, 1), slvalue,
Colors(ct, 3))
Case 3
RGBCode = RGB(Colors(ct, 1), Colors(ct, 2),
slvalue)
Search WWH ::




Custom Search