Code:
Public Function AutoFitFlexGrid(ByVal flx As MSHFlexGrid, frm As Form)
Dim r As Long
Dim C As Long
Dim cell_wid As Single
Dim col_wid As Single


    For C = 0 To flx.Cols - 1
        col_wid = 0
        For r = 0 To flx.Rows - 1
            cell_wid = frm.TextWidth(flx.TextMatrix(r, C))
            If col_wid < cell_wid Then col_wid = cell_wid
        Next r
        flx.ColWidth(C) = col_wid + 150
    Next C
End Function
may help your problem...