Error de compilación: Se esperaba una matriz
Tengo una macro en que entre las Xs es del amigo Dante
Private Sub CommandButton1_Click() 'Saving Button Dim sonsat As Long 'XXXX Dim vcS As String Dim vtx As String Dim i As Double Application.ScreenUpdating = False '1º Array de nombre de control vcS = Array("Textbox1", "Textbox2", "Textbox3", "Textbox4", "TextBox5", "TextBox6", "TextBox8") '2º Array de mensaje a presentar segun el orden de los controles vtx = Array("Minimo 1º Nombre y 1º apellido", "Nombre de compañia", "Dirección de residencia", _ "Ciudad", "País de Residencia", "El Estado", "El # de Teléfono") For i = LBound(vcS) To UBound(vcS) 'ME MARCA EN LBound If Controls(vcS(i)) = Empty Then MsgBox "DEBES INTRODUCIR: " & vtx(i), vbExclamation, "ALTA" Exit Sub End If Next 'XXXXX If Not IsNumeric(TextBox12.Text) Then MsgBox "Please enter a Numeric Value.", vbExclamation TextBox12.SetFocus Exit Sub End If sonsat = Sheets("Data").[a65536].End(3).Row + 1 Call Main 'Progress Bar Cells(sonsat, 1) = TextBox1 Cells(sonsat, 2) = TextBox2 Cells(sonsat, 3) = TextBox3 Cells(sonsat, 4) = TextBox4 Cells(sonsat, 5) = TextBox5 Cells(sonsat, 6) = TextBox6 Cells(sonsat, 7) = TextBox7 Cells(sonsat, 8) = TextBox8 Cells(sonsat, 9) = TextBox9 Cells(sonsat, 10) = TextBox10 Cells(sonsat, 11) = TextBox11 Cells(sonsat, 12) = TextBox12 MsgBox "Registro completo ListBox1.List = Sheets("Data").Range("a2:l" & [a65536].End(3).Row).Value 'For refresh listbox TextBox14.Value = ListBox1.ListCount Application.ScreenUpdating = True End Sub
Al inicio de la macro es para no dejar esos controles vacíos al introducir los datos.
Me manda el error en línea For i = LBound(vcS) To UBound(vcS) marcando LBound, no se que hacer
Agradecido por su generosa ayuda
1 Respuesta
Respuesta de Dante Amor
1