Boa tarde!!
Veja se assim funciona
Private Sub TextBox1_Exit(ByVal Cancel As MSForms.ReturnBoolean)
Select Case True
Case TextBox1.Value = ""
Case TextBox2.Value = ""
On Error Resume Next
TextBox2 = Mid(TextBox1, 28, 7) ' Fórmula extrair texto
On Error GoTo 0
TextBox1.Value = ""
Cancel = True
Case TextBox3.Value = ""
On Error Resume Next
TextBox3 = Mid(TextBox1, 28, 7) ' Fórmula extrair texto
On Error GoTo 0
TextBox1.Value = ""
Cancel = True
Case TextBox4.Value = ""
TextBox4.Value = TextBox1
TextBox1.Value = ""
Cancel = True
Case TextBox5.Value = ""
TextBox5.Value = TextBox1
TextBox1.Value = ""
Cancel = True
Case TextBox6.Value = ""
TextBox6.Value = TextBox1
TextBox1.Value = ""
Cancel = True
Case TextBox7.Value = ""
TextBox7.Value = TextBox1
TextBox1.Value = ""
Cancel = True
Case Else
MsgBox "Todas as Caixas forma preenchidas. ", vbInformation, "Preenchimento"
End Select
End Sub
Existem mil maneiras de preparar Neston. Invente a sua!
http://www.youtube.com/ExpressoExcel
Postado : 31/03/2013 11:29 am