UserForm + CheckBox + Hide/Unhide Columns

rsbuzatto

Board Regular
Joined
Mar 19, 2012
Messages
70
Hey folks,

I'm writing a VBA code to control the months of a process that I have here. However, I'd like to know if is there any good way to do it.

My UserFormis simple:
scaled.php


Jan May Sep No Selection
Feb Jun Oct Select All
Mar Jul Nov Data View
Apr Aug Dec




What I'd like to do is simple, as well: I need to press my Data View (Visualizar Dados) button and HIDE or UNHIDE (toggle) my month's data table.

Example: I'll select January and press Data View button and then, whether the January columns is hidden or not, do what I need. If January columns is hidden, my code must unhidden then and so on... If I check 2...3...7 months, my code must hide or unhide the columns.


TIP: Every month table has 6 columns, so I need to hide those 6 or unhide all of those six.

Can you guys help me?


Thanks a million!
 
Last edited:

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
Try something like the following example,
Code:
[FONT="Consolas"][SIZE="2"][COLOR="Navy"]Private Sub CheckBox1_Click()
    Columns("A:G").Hidden = Not CheckBox1.Value
End Sub[/COLOR][/SIZE][/FONT]
 
Upvote 0

Forum statistics

Threads
1,203,233
Messages
6,054,275
Members
444,714
Latest member
excel2782

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top