My table includes data associated with a code. These codes are 2 to 6 digits long. I've formatted that column as text and counted the character length in Column A. I've applied a filter to that column and recorded a macro of me selecting the 2-digit code data and pasting it in a new worksheet, then starting over and selecting for the 3-digit code data etc. I"ve attached the practice file to this thread: SepCodeByDigitNumber.xlsm.

The macro is called Sub SeparateCodesByDigitLength() [see attached file], and it's pretty long or I'd insert it here.
I need help editing this code to be more streamlined (I'm sure it could loop etc.). I've done some editing so far but don't want to delete something I shouldn't.

Thank you for your help in advance. Happy New Year! Enjoy the holiday!