Hi, Youyiyang,
In A2010, it seems to create command buttons using macros to do the work instead of a VBA event procedure as in A2003, but there is an option to convert the macro into VBA, which I did. The converted code which A2010 created wasn't the same as in your example, but I tried to...