I would like to hide/unhide columns based on whether I put an 'x' in row 1. I presume that I have to determine the last used column and then do a for each along row 1 to evaluate if there is the value 'x' in it. If it does then hide it or unhide it depending on which of the two actions I have chosen. What I need help with is how to reference the column by number so that the for each loop works. With the code below, how can I refer to the "L:L" numerically so that the loop works?
Or, maybe there is a whole better approach than what I am thinking. In any case, any pointers much appreciated.
![]()
Columns("L:L").Select Selection.EntireColumn.Hidden = True
Bookmarks