zborton
New Member
- Joined
- Jun 25, 2015
- Messages
- 7
I currently have a user form with many check boxes to hide/show columns based on if a check box is checked or not. Right now I have the code refer to the columns based on thier letter and everything works great. I would like to have the code refer to the name of the columns rather than the letter to make everything more robust in case columns get deleted or moved around in the future.
Original working code:
Non-working idea of what I would like:
I have defined columns "ac:af" as the name "steer".
Original working code:
Code:
Private Sub update_botton_Click()
'====================================================
'Update sheet based on checkbox selections
'====================================================
With Sheets("sheet1")
'Hides all the columns that steer are in
Columns("ac:af").Hidden = Not (steer_cb)
Non-working idea of what I would like:
I have defined columns "ac:af" as the name "steer".
Code:
Private Sub update_botton_Click()
'====================================================
'Update sheet based on checkbox selections
'====================================================
With Sheets("sheet1")
'Hides all the columns that steer are in
range("steer").Hidden = Not (steer_cb)