Debug.Print iMax
    If (iMax &lt; 1) Then
        MsgBox "Filters must be at least 3x3 in size.", vbInformation
        Exit Sub
    End If
    
    iSIze = iMax * 2 + 1
    ' Store size, weight and filter coefficients:
    m_cI.FilterArraySize = iSIze
    m_cI.FilterWeight = Val(txtWeight.Text)
    
    iIndex = 3 - iSIze \ 2 + ((3 - iSIze \ 2)) * 7
    For i = -iMax To iMax
        For j = -iMax To iMax
            m_cI.FilterValue(i, j) = Val(txtValue(iIndex).Text)
            iIndex = iIndex + 1
      