Welcome to the forum.
It can be done, and Chip Pearson has a good article on it (see
Programming In The VBA Editor), but I would try and find another way.
Code that modifies itself looks suspect to a lot of virus scanners which may block your file. You also need to leave the project unlocked and (I think) reduce security levels.