This is a code I just created for another user. Converting dates.
According to what you mentioned above, if I understand correctly you want to script while performing such a procedure, right? If positive try putting the command Exit Sub
(no quotes) at the place where you want to stop the code. Follow template below.
Look for this remark in the script below to better understand: <----- este é o código que faz parar o script.
Dim CData As Date
Dim CData2 As Date
Sub DataCompra1()
{'--- FORMATANDO DATA MOD 01}
[C8].Select
CData = [C8].Value
If CData = "0" Then
MsgBox "INFORME A DATA"
'Exit Sub '--- ESTA FUNÇÃO PARA O SCRIPT, CASO QUEIRA UTILIZAR DESCOMENTE A LINHA
Else
ActiveCell.Value = ""
Selection.Offset(0, 2).Select
ActiveCell.Value = CData
Exit Sub '<----- ESTE É O CÓDIGO QUE FAZ PARAR O SCRIPT.
MsgBox CData
End If
End Sub
Sub DataCompra2()
{'--- FORMATANDO DATA MOD 02}
Dim CData As Date
Dim CHora As Date
dt = [C8].Value
CData = Format(dt)
CHora = Format(Now)
[E8].Value = CData
[E9].Value = CHora
End Sub
Sub LimparData()
[C8].Value = ""
[E8].Value = ""
End Sub
Good afternoon, I believe that trying to solve the problem that occurs would be the easiest and most correct way for your purpose. Put the code part of this sub so we can help you.
– Umberto Santos
Sub
is not a class module– danieltakeshi