Hi. The only way that I can figure out to do it will take lines and lines of code, and I am hoping that there is an easier way.
I have a UserForm set up with one box a drop-down combo list for the users to select which practice code they are opening this file under. There are 85 of these lines (if I start counting at 0) and each one is added with an additem code. (i.e. .AddItem “CORP 10 Corporate – Incorporation”).
I have grouped all 85 practice codes so that if any of the lines 0-21 are chosen, then the practice group is =1, lines 22-29 = 7, etc.
I need to have the macro fill in the Practice Group automatically into a box on the Word form based on which practice code the user chooses. However, the only way I can actually get this to work is by using If … Then statements on each individual line. For example: If cboPracticeCode = “CORP 10 Corporate – Incorporation” then
strPracGroup=1
and do this for each line.
Is there any way for me to specify to the macro that if lines 0-21 are selected by the user, then strPracGroup=1? I have tried value and list, but I haven’t got either one to work. Hopefully, there is an easier way.
I hope this makes sense. Any input would be appreciated.