Function PopulateResults()

    Dim y As Integer
    Dim x As Integer
    Dim noresults As Integer
    Dim resultlocx As Integer
    Dim resultlocy As Integer
    
    noresults = 21
    
    Range("U:Am").Interior.Color = RGB(255, 255, 255)
    Range("U16:Am48").ClearContents
    
    For y = 1 To noresults
        If Worksheets("Data").Cells(y, 3).Value > 0 Then
            'Pick result location
            Select Case y
            Case 1
                resultlocx = 21
                resultlocy = 16
            Case 2
                resultlocx = 26
                resultlocy = 16
            Case 3
                resultlocx = 31
                resultlocy = 16
            Case 4
                resultlocx = 21
                resultlocy = 21
            Case 5
                resultlocx = 26
                resultlocy = 21
            Case 6
                resultlocx = 31
                resultlocy = 21
            Case 7
                resultlocx = 21
                resultlocy = 26
            Case 8
                resultlocx = 26
                resultlocy = 26
            Case 9
                resultlocx = 31
                resultlocy = 26
            Case 10
                resultlocx = 21
                resultlocy = 31
            Case 11
                resultlocx = 26
                resultlocy = 31
            Case 12
                resultlocx = 31
                resultlocy = 31
            Case 13
                resultlocx = 21
                resultlocy = 36
            Case 14
                resultlocx = 26
                resultlocy = 36
            Case 15
                resultlocx = 31
                resultlocy = 36
            Case 16
                resultlocx = 21
                resultlocy = 41
            Case 17
                resultlocx = 26
                resultlocy = 41
            Case 18
                resultlocx = 31
                resultlocy = 41
            Case 19
                resultlocx = 21
                resultlocy = 46
            Case 20
                resultlocx = 26
                resultlocy = 46
            Case 21
                resultlocx = 31
                resultlocy = 46
            End Select
            
            'Populate results
            Cells(resultlocy, resultlocx).Value = Cells(Worksheets("Data").Cells(y, 1).Value, Worksheets("Data").Cells(y, 2).Value).Value
            If Cells(resultlocy, resultlocx).Value = Cells(11, 21).Value Then
                Cells(resultlocy, resultlocx).Interior.Color = RGB(255, 255, 0)
            Else
                Cells(resultlocy, resultlocx).Interior.Color = RGB(255, 255, 255)
            End If
            Cells(resultlocy, resultlocx + 1).Value = Cells(Worksheets("Data").Cells(y, 1).Value, Worksheets("Data").Cells(y, 2).Value + 1).Value
            If Cells(resultlocy, resultlocx + 1).Value = Cells(11, 22).Value Then
                Cells(resultlocy, resultlocx + 1).Interior.Color = RGB(255, 255, 0)
            Else
                Cells(resultlocy, resultlocx + 1).Interior.Color = RGB(255, 255, 255)
            End If
            Cells(resultlocy, resultlocx + 2).Value = Cells(Worksheets("Data").Cells(y, 1).Value, Worksheets("Data").Cells(y, 2).Value + 2).Value
            If Cells(resultlocy, resultlocx + 2).Value = Cells(11, 23).Value Then
                Cells(resultlocy, resultlocx + 2).Interior.Color = RGB(255, 255, 0)
            Else
                Cells(resultlocy, resultlocx + 2).Interior.Color = RGB(255, 255, 255)
            End If
            Cells(resultlocy + 1, resultlocx).Value = Cells(Worksheets("Data").Cells(y, 1).Value + 1, Worksheets("Data").Cells(y, 2).Value).Value
            If Cells(resultlocy + 1, resultlocx).Value = Cells(12, 21).Value Then
                Cells(resultlocy + 1, resultlocx).Interior.Color = RGB(255, 255, 0)
            Else
                Cells(resultlocy + 1, resultlocx).Interior.Color = RGB(255, 255, 255)
            End If
            Cells(resultlocy + 1, resultlocx + 1).Value = Cells(Worksheets("Data").Cells(y, 1).Value + 1, Worksheets("Data").Cells(y, 2).Value + 1).Value
            If Cells(resultlocy + 1, resultlocx + 1).Value = Cells(12, 22).Value Then
                Cells(resultlocy + 1, resultlocx + 1).Interior.Color = RGB(255, 255, 0)
            Else
                Cells(resultlocy + 1, resultlocx + 1).Interior.Color = RGB(255, 255, 255)
            End If
            Cells(resultlocy + 1, resultlocx + 2).Value = Cells(Worksheets("Data").Cells(y, 1).Value + 1, Worksheets("Data").Cells(y, 2).Value + 2).Value
            If Cells(resultlocy + 1, resultlocx + 2).Value = Cells(12, 23).Value Then
                Cells(resultlocy + 1, resultlocx + 2).Interior.Color = RGB(255, 255, 0)
            Else
                Cells(resultlocy + 1, resultlocx + 2).Interior.Color = RGB(255, 255, 255)
            End If
            Cells(resultlocy + 2, resultlocx).Value = Cells(Worksheets("Data").Cells(y, 1).Value + 2, Worksheets("Data").Cells(y, 2).Value).Value
            If Cells(resultlocy + 2, resultlocx).Value = Cells(13, 21).Value Then
                Cells(resultlocy + 2, resultlocx).Interior.Color = RGB(255, 255, 0)
            Else
                Cells(resultlocy + 2, resultlocx).Interior.Color = RGB(255, 255, 255)
            End If
            Cells(resultlocy + 2, resultlocx + 1).Value = Cells(Worksheets("Data").Cells(y, 1).Value + 2, Worksheets("Data").Cells(y, 2).Value + 1).Value
            If Cells(resultlocy + 2, resultlocx + 1).Value = Cells(13, 22).Value Then
                Cells(resultlocy + 2, resultlocx + 1).Interior.Color = RGB(255, 255, 0)
            Else
                Cells(resultlocy + 2, resultlocx + 1).Interior.Color = RGB(255, 255, 255)
            End If
            Cells(resultlocy + 2, resultlocx + 2).Value = Cells(Worksheets("Data").Cells(y, 1).Value + 2, Worksheets("Data").Cells(y, 2).Value + 2).Value
            If Cells(resultlocy + 2, resultlocx + 2).Value = Cells(13, 23).Value Then
                Cells(resultlocy + 2, resultlocx + 2).Interior.Color = RGB(255, 255, 0)
            Else
                Cells(resultlocy + 2, resultlocx + 2).Interior.Color = RGB(255, 255, 255)
            End If
        
        
        End If

    
    Next y

End Function
upgrade this code to 5x5 output boxes