Given that your flex grid rows and columns start at zero then

Row = value \ 10

column = (value - 1) Mod 10

e.g. If value = 21 then row = 21 \ 10 = 2, column = (21 - 1) mod 10 = 0

So you'd find 21 in row 2, column 0 in the grid.

after testing the code is close except the last column is off by 1 row

mMarkedNumber(1) = 1

mMarkedNumber(2) = 5

mMarkedNumber(3) = 10 'selects 20

mMarkedNumber(4) = 21

mMarkedNumber(5) = 26

mMarkedNumber(6) = 46

mMarkedNumber(7) = 50 'selects 60

mMarkedNumber(8) = 71

mMarkedNumber(9) = 76

mMarkedNumber(10) = 80 'invalid row value

'seems the last column row value is 1 number too many

This modification seems to fix problem, but not sure if this is the correct way

If Right(nu, 1) = 0 Then

.Row = nu \ 10 - 1 ' minus 1 if the last column

.Col = (nu - 1) Mod 10

Set .CellPicture = imgSelNotHit

Else

.Row = nu \ 10

.Col = (nu - 1) Mod 10

Set .CellPicture = imgSelNotHit

End If