Have you tried the built in function of filter? You can filter the columns by data drop down. See if that helps.
You could possibly sort, also. Both are built in ready to use actions, no programming required. What you are asking is a Macro, and not easy to deploy if you are not familiar with them!