Hello there,
I searched through the questions and didn't find any question regarding arguments in sub procedures.
I am trying to write a code that will require a number for a variable (i), but if no number is typed in, it will use its default value.
Sub Ende(Optional Teste As Long = 30000000)
Teste = Application.InputBox("Defina o CEP: ", "Endereço")
MsgBox "O CEP é: " & Teste
End Sub
but nothing happens when I press F5 or F8.
When I remove the arguments, it runs normally.
What am I doing wrong here?
Best Regards,
Marcos.
I searched through the questions and didn't find any question regarding arguments in sub procedures.
I am trying to write a code that will require a number for a variable (i), but if no number is typed in, it will use its default value.
Sub Ende(Optional Teste As Long = 30000000)
Teste = Application.InputBox("Defina o CEP: ", "Endereço")
MsgBox "O CEP é: " & Teste
End Sub
but nothing happens when I press F5 or F8.
When I remove the arguments, it runs normally.
What am I doing wrong here?
Best Regards,
Marcos.