Hi

Do you need it only with VBA code?

Because you can do it using Custom Validation, also.