While coding in vba, I noticed that when we are expecting an error and then write "on error resume next". And when an error really occurs, then will the err value be increased to 1. A simple sample code below.
Dim ws as worksheets
On error resume next
Set ws = sheets("hellosheet") ' hellosheet doesn't exist
If err <> 0 then
Msgbox "the worksheet hellosheet doesn't exist"
End if
As you can see hellosheet doesn't exist making the code to be error. Will the err value in this part be increased to 1. Please help me understand the logic if i am missing something. Thank you