Duplicate threads merged.
Please do not make duplicate threads.

No, you cant write like VBA. Use the logic like nmadd posted.