Abre un proyecto nuevo En un formulario agrega el control flexgrid A la barra de herramientas - Microsoft FlexGrid Control x.x (C:\Windows\System\MSFLXGRD.ocx) Agraga al Form: 2 textbox 2 labels 1 commandbuton 1 flexgrid ((((((( No modifiques los nombres de los controles! ))))) Y este es el codigo! Para ver una matriz en un FlexGrid espero que te sirva! '-------------------------------------------------------------------- Option Explicit Dim Renglon As Integer, Columna As Integer Private Sub Command1_Click() On Error GoTo xError Dim x As Integer, xx As Integer, y As Integer, yy As Integer Dim Matriz() Renglon = Val(Me.Text1) Columna = Val(Me.Text2) ReDim Matriz(Columna, Renglon) yy = UBound(Matriz, 2) xx = UBound(Matriz) '----------- Llenado de la Matriz ------------------------------- For x = 0 To xx For y = 0 To yy Matriz(x, y) = (Int(Rnd * 500) + 1) 'Caracteres Chr$(Int(Rnd * 255) + 1) Next y Next x '------- Establecer Columnas y Renglones en el FlexGrid ------- Me.MSFlexGrid1.Cols = xx + 1 Me.MSFlexGrid1.Rows = yy + 1 'Me.MSFlexGrid1.TextMatrix(0, 0) = Columna & " x " & Renglon '----------- Titulos ------------------------------- For x = 1 To xx Me.MSFlexGrid1.TextMatrix(0, x) = x - 1 Next x For y = 1 To yy Me.MSFlexGrid1.TextMatrix(y, 0) = y - 1 Next y '--------------------------------------------------- '-------------- Llenar FlexGrid -------------------- For x = 1 To xx For y = 1 To yy Me.MSFlexGrid1.TextMatrix(y, x) = Matriz(x - 1, y - 1) Next y Next x '--------------------------------------------------- xError: End Sub Private Sub Form_Load() MsgBox "Diseñado en Resolucion 800 x 600 ", vbInformation, "VbGopher" '---- Form -------- With Form1 .Caption = "Matrices - vbGopher [www.TodoExpertos.com] (14/04/04)" .WindowState = vbMaximized End With '------ Flex ----- With MSFlexGrid1 .Height = 7575 .Width = 8655 .Left = 120 .Top = 120 End With '-----TexBox(s)------ With Text1 .Left = 8880 .Height = 375 .Top = 480 .MaxLength = 2 .Text = 3 .Width = 1695 End With With Text2 .Left = 8880 .Height = 375 .Top = 1200 .MaxLength = 2 .Text = 6 .Width = 1695 End With '------ Labels -------- With Label1 .Caption = "Renglones:" .Left = 8880 .Top = 240 .Height = 195 .Width = 600 End With With Label2 .Caption = "Columnas:" .Left = 8880 .Top = 960 .Height = 195 .Width = 615 End With '-------CommandButton-------------- With Me.Command1 .Caption = "&Llenar Flex" .Default = True .Left = 8880 .Height = 735 .Top = 1680 .Width = 1695 End With '---------------------- End Sub '--------------------Fin de Codigo -------------------------------- VbGopher!