Error en el metodo Value de objeto Range

En un botón de guardar, me sale el error en el método Value de Objeto Range. Se ha producido el error 2147417848 (080010108) en tiempo de ejecución.

Continuar finalizar depurar ayuda

Y se cierra el archivo sin guardar.

La línea que me da fallo es esta

Sheets("PARTIDOS").Range("B" & ultimo).Value = Me.TextBox1.Value

Pongo todo el código para más información

'BOTÓN GUARDAR

Private Sub CommandButton1_Click()
Dim TABLAPARTIDOS As ListObject
Dim ultimo As Integer
Set TABLAPARTIDOS = Sheets("PARTIDOS").ListObjects("tabla2")
ultimo = TABLAPARTIDOS.Range(TABLAPARTIDOS.Range.Rows.Count, 1).Row + 1
MsgBox (ultimo) ' Para saber si es la ultima fila 
Sheets("PARTIDOS").Range("B" & ultimo).Value = Me.TextBox1.Value
Sheets("PARTIDOS").Range("C" & ultimo).Value = Me.TextBox2.Value
Sheets("PARTIDOS").Range("D" & ultimo).Value = Me.TextBox3.Value
Sheets("PARTIDOS").Range("E" & ultimo).Value = Me.TextBox4.Value
Sheets("PARTIDOS").Range("F" & ultimo).Value = Me.TextBox5.Value
Sheets("PARTIDOS").Range("G" & ultimo).Value = Me.TextBox6.Value
Sheets("PARTIDOS").Range("H" & ultimo).Value = Me.TextBox7.Value
Sheets("PARTIDOS").Range("I" & ultimo).Value = Me.TextBox8.Value
TextBox1.Value = Empty
TextBox2.Value = Empty
TextBox3.Value = Empty
TextBox4.Value = Empty
TextBox5.Value = Empty
TextBox6.Value = Empty
TextBox7.Value = Empty
TextBox8.Value = Empty
End Sub

1 Respuesta

Respuesta

Añade tu respuesta

Haz clic para o

Más respuestas relacionadas