I m trying to change color of cells based on value fron another sheets

```
Sub ColoredOutlier()

    Dim i As Integer, j As Integer, x As Integer

    For i = 1 To 50

        For j = 2 To 23

            If IsEmpty(Worksheets("outlier_index").Cells(i, j)) Then Exit For

            x = Worksheets("outlier_index").Cells(i, j).Value

            Worksheets("Sheet2").Cells(x+1, i).Interior.ColorIndex = 3  

        Next j   

   Next i  

End Sub

```

When ı run these codes above I m getting "type mismatch" error becasue of 

> 
> x = Worksheets("outlier\_index").Cells(i, j).Value
> 
> 
> 

Could anyone help me about solve my problem?