|That is not a formula. That is a macro.|
Please read my response to your other post: Auto Calculating vs. Macros.
The first 2 examples at the site I suggested show how to do exactly what you want to do.
I'll assume that either you didn't read my response, or you didn't review the site I suggested.