I am new to VBA. I am working on an Excel project and I see the code in the project that looks like this:
If Me.Columns(i).Hidden = True Then Me.Columns(i).Hidden = False End If
and this:
If Range("SomeRange").Locked = True Then Range("SomeRange").Locked = False End If
In such cases, in particular, can there be any reason to check whether the property is set before setting it, or is it just a useless check? Of course, the VBA engine needs to do an internal check so that it doesn't do anything unnecessarily.
source share