Public Function IsSelected(intNumber As Integer) As Boolean
'new 6
Dim intRow As Integer
Dim intCol As Integer
Select Case intNumber
Case 1 To 10
intRow = 0
Case 11 To 20
intRow = 1
Case 21 To 30
intRow = 2
Case 31 To 40
intRow = 3
Case 41 To 50
intRow = 4
Case 51 To 60
intRow = 5
Case 61 To 70
intRow = 6
Case 61 To 80
intRow = 7
End Select
intCol = intNumber Mod 10 - 1
If intCol = -1 Then
intCol = 9
End If
With frmCleo.flexCleo
.Row = intRow
.Col = intCol
.RowSel = intRow
.ColSel = intCol
If .CellForeColor = vbYellow Then
IsSelected = True
End If
End With
End Function
Public Function IsSelected(intNumber As Integer) As Boolean
'new 6
Dim intRow As Integer
Dim intCol As Integer
' The use of / yields whole numbers
intRow = (intNumber - 1) / 10
intCol = intNumber Mod 10 - 1
If intCol = -1 Then
intCol = 9
End If
With frmCleo.flexCleo
.Row = intRow
.Col = intCol
.RowSel = intRow
.ColSel = intCol
If .CellForeColor = vbYellow Then
IsSelected = True
End If
End With
End Function
Did you mean to use the \ operator?Yes I did, nice catch.
Public Function IsSelected(intNumber As Integer) As Boolean
'new 6
Dim intRow As Integer
Dim intCol As Integer
' The use of \ yields whole numbers
intRow = (intNumber - 1) \ 10
intCol = intNumber Mod 10 - 1
If intCol = -1 Then
intCol = 9
End If
With frmCleo.flexCleo
.Row = intRow
.Col = intCol
.RowSel = intRow
.ColSel = intCol
If .CellForeColor = vbYellow Then
IsSelected = True
End If
End With
End Function
Join the community of 500,000 technology professionals and ask your questions.
Connect with top rated Experts
11 Experts available now in Live!