If Not SomeText Like "*[!0-9]*" Then
MsgBox "SomeText contains only digits in it."
End If
Could you expand upon that?If you are teaching Excel error handling, it is important in my opinion to also teach why it is a flawed design.
On Error Goto -1? Really?
It's based on obsolete VB6 technology and goto statements. It is a bit awkward to control the program flow. Modern VB.NET employs structured exception handling which is far more elegant and straightforward, as do many other programming languages like C++.Could you expand upon that?
In what situation do you think it is flawed (I suppose anything could be flawed if not done properly)?
Do you think it is better to not address errors at all?
On Error Goto -1
. Most people don't even know it exists in VBA. (and I'd just clarify it's VBA error handling, not Excel ) IMO, if you're using that, you've dug yourself into a hole with some bad code and gone looking round the internet for a solution that didn't involve rewriting your code properly.