Te anexo el código actualizado
Sub insertar()
'Por.Dante Amor http://www.todoexpertos.com/preguntas/6dfdswlh5iak7bjd/correccion-para-macro-excel-para-insertar-datos-mandando-error
'Obligar a llenar las cajas del 6 al 9
Dim vcs, vtx, LastRow, u ', i
Dim i As Double
Application.ScreenUpdating = False
ActiveSheet.Unprotect Password:="By Jot@"
'quita colores
Range("B11:K46, M11:V46").Font.ColorIndex = vbBlack
Range("B11:K46, M11:V46").Font.Bold = wbold
Range("B11:K46, M11:V46").Interior.ColorIndex = 0
Errores = False 'variable para verificar uno a uno o TODOS A LA VES los TextBox
'Insertar Ultimos datos
If CheckBox1 Then
'Mensage sobre TextBox para Datos Finales
'
If OptionButton1 = False And OptionButton2 = False Then
MsgBox "Selecciona una página"
Exit Sub
End If
'
vcs = Array("DTPicker1", "Textbox7", "Textbox8", "Textbox9", "Textbox10", "Textbox11")
vtx = Array("UNA FECHA VALIDA", "EL NOMBRE DE EMPRESA", "REPESTOS PARA", "EL SERIAL MAQ/MOT", "LA MARCA", "EL MODELO/IDENT.")
For i = LBound(vcs) To UBound(vcs)
If Me.Controls(vcs(i)) = Empty Then
MsgBox "DEBES INTRODUCIR: " & vtx(i), vbExclamation, "LLENAR LISTA"
Me.Controls(vcs(i)).SetFocus
'Exit Sub 'Colocado este aqui, verifica uno a uno los TextBox. No hace parte de la variable errores
Errores = True
End If
If Errores Then Exit Sub 'Colocado aqui, verifica uno a uno los TextBox
Next
'If errores Then Exit Sub 'Colocado aqui, verifica TODOS TextBox a la ves
'
'If Range("c8") = "" Then 'SI LA C8 ESTA VACIA, INSERTA EN LA 1ª PAGINA
If OptionButton1 Then
Range("C8") = DTPicker1 'Fecha
Range("E8") = TextBox7 'Nombre Empresa
Range("J8") = TextBox8 'Repuestos para
Range("D9") = TextBox9 'Serial Maq/Mot.
Range("G9") = TextBox10 'Marca
Range("K9") = TextBox11 'Modelo/Ident.
Range("D47").Value = Left(TextBox12.Value, 450) 'Notas
Else 'Si encuentra la C8 ya llena inserta en la 2ª pagina
Range("N8") = DTPicker1 'Fecha
Range("P8") = TextBox7 'Nombre Empresa
Range("U8") = TextBox8 'Repuestos para
Range("O9") = TextBox9 'Serial Maq/Mot.
Range("R9") = TextBox10 'Marca
Range("V9") = TextBox11 'Modelo/Ident.
Range("O47").Value = Left(TextBox12.Value, 450) 'Notas
End If
TextBox7.SetFocus
''''''''''''
Else
'Mensage sobre TextBox para Productos
vcs = Array("TextBox1", "Textbox2", "Textbox3", "Textbox4", "Textbox5")
vtx = Array("UN ITEM", "EL # DE PRODUCTO", "LA DESCRIPCION DEL PRODUCTO", "LA CANTIDAD", "EL # DE PAGINA")
For i = LBound(vcs) To UBound(vcs)
If Me.Controls(vcs(i)) = Empty Then
MsgBox "DEBES INTRODUCIR: " & vtx(i), vbExclamation, "LLENAR LISTA"
'Exit Sub 'Colocado este aqui, verifica uno a uno los TextBox. No hace parte de la variable errores
Me.Controls(vcs(i)).SetFocus
Errores = True
End If
If Errores Then Exit Sub 'Colocado aqui, verifica uno a uno los TextBox
Next
'If errores Then Exit Sub 'Colocado aqui, verifica TODOS TextBox a la ves
If CheckBox2 Then
'modifica producto
fil = Val(ComboBox1.List(ComboBox1.ListIndex, 2))
col = Val(ComboBox1.List(ComboBox1.ListIndex, 3))
Else
'inserta producto
fil = 11
col = Columns("B").Column
Do While Cells(fil, col) <> ""
fil = fil + 1
If fil = 47 Then col = Columns("M").Column: fil = 11
Loop
End If
''''''
wcolor = vbBlack: wbold = False
If CheckBox4 Then wcolor = 3: wbold = True
Call Formatear(fil, col, wcolor, wbold, TextBox1.Text)
Call Formatear(fil, col + 1, wcolor, wbold, TextBox2.Text)
Call Formatear(fil, col + 2, wcolor, wbold, TextBox3.Text)
Call Formatear(fil, col + 8, wcolor, wbold, TextBox4.Text)
Call Formatear(fil, col + 9, wcolor, wbold, TextBox5.Text)
'
' wcolor = vbBlack: wbold = False
' If CheckBox3 Then wcolor = 3: wbold = True
' Cells(fil, col) = TextBox1 'Item #
' Cells(fil, col + 1) = TextBox2 'Producto #
' Cells(fil, col + 2) = TextBox3 'Descripcion del Producto
' Cells(fil, col + 8) = TextBox4 'Cant.
' Cells(fil, col + 8).Font.ColorIndex = wcolor
' Cells(fil, col + 8).Font.Bold = wbold
' Cells(fil, col + 9) = TextBox5 'Pagina #
''''''
Call CargaCombobox2
TextBox1.SetFocus
End If
ActiveSheet.Protect Password:="By Jot@"
Call Limpiar
ComboBox1 = ""
'Subir la hoja
If Range("C46") = "" Then
'Obtener la última fila con datos de la columna B
u = Range("B" & Rows.Count).End(xlUp).Row
'Si la ventana tiene los paneles inmovilizados, entonces n va a ser igual a 10 de lo contrario n =17
If ActiveWindow.FreezePanes = True Then n = 16 Else n = 23 'original es 10 17
'Ahora si la última fila con dato es mayor a 17, significa que tengo que mover los datos de la ventana "scroll"
'Entonces voy a mover la ventana haciendo un scroll hasta la última fila pero le resto las filas que quiero que permanezcan visibles.
If u > 23 Then ActiveWindow.ScrollRow = u - n
Else
'Obtener la última fila con datos de la columna M
u = Range("M" & Rows.Count).End(xlUp).Row
If ActiveWindow.FreezePanes = True Then n = 16 Else n = 23 'original es 10 17 Se puede jugar con estos números
If u > 23 Then ActiveWindow.ScrollRow = u - n 'Original 17
End If
Application.ScreenUpdating = True
End Subsal u dos