ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Check boxes (https://www.excelbanter.com/excel-worksheet-functions/142096-check-boxes.html)

Min

Check boxes
 
I have a workbook with 14 worksheets. Each worksheet has 6 checkboxes that
when true will show columns and when false will hide them again. The
checkboxes perform the same function on each worksheet. At the moment I have
the code on each sheet - exactly the same code 14 times over!
Is there any way of putting the code into just one place?
I tried doing it with macros but, although the columns would hide, they
wouldn't show again when the box was deselected.
Any help would be greatly appreciated, but my knowledge is very limited so
explanations need to be one step at a time!
Many thanks.

Dave Peterson

Check boxes
 
Hmmmm.

You may want to go back to your other thread in .misc and explain what you tried
and what didn't work.

Min wrote:

I have a workbook with 14 worksheets. Each worksheet has 6 checkboxes that
when true will show columns and when false will hide them again. The
checkboxes perform the same function on each worksheet. At the moment I have
the code on each sheet - exactly the same code 14 times over!
Is there any way of putting the code into just one place?
I tried doing it with macros but, although the columns would hide, they
wouldn't show again when the box was deselected.
Any help would be greatly appreciated, but my knowledge is very limited so
explanations need to be one step at a time!
Many thanks.


--

Dave Peterson

Min

Check boxes
 
I read your suggestions and I tried doing it with macros but, although the
columns would hide, they wouldn't show again when the box was deselected.

Unfortunately my knowledge of vb is limited and I couldn't understand where
to put the code that you suggested!
I can do macros, so I was trying to make that work as it seemed to be the
least complicated solution.



"Dave Peterson" wrote:

Hmmmm.

You may want to go back to your other thread in .misc and explain what you tried
and what didn't work.

Min wrote:

I have a workbook with 14 worksheets. Each worksheet has 6 checkboxes that
when true will show columns and when false will hide them again. The
checkboxes perform the same function on each worksheet. At the moment I have
the code on each sheet - exactly the same code 14 times over!
Is there any way of putting the code into just one place?
I tried doing it with macros but, although the columns would hide, they
wouldn't show again when the box was deselected.
Any help would be greatly appreciated, but my knowledge is very limited so
explanations need to be one step at a time!
Many thanks.


--

Dave Peterson


Dave Peterson

Check boxes
 
The code I suggested is placed in the ThisWorkbook module.

If you're not sure where this is, you may want to look at Debra Dalgleish's
site. She has some pictures that show this (for a different purpose, though):

http://contextures.com/xlfaqMac.html#NoMacros

Min wrote:

I read your suggestions and I tried doing it with macros but, although the
columns would hide, they wouldn't show again when the box was deselected.

Unfortunately my knowledge of vb is limited and I couldn't understand where
to put the code that you suggested!
I can do macros, so I was trying to make that work as it seemed to be the
least complicated solution.

"Dave Peterson" wrote:

Hmmmm.

You may want to go back to your other thread in .misc and explain what you tried
and what didn't work.

Min wrote:

I have a workbook with 14 worksheets. Each worksheet has 6 checkboxes that
when true will show columns and when false will hide them again. The
checkboxes perform the same function on each worksheet. At the moment I have
the code on each sheet - exactly the same code 14 times over!
Is there any way of putting the code into just one place?
I tried doing it with macros but, although the columns would hide, they
wouldn't show again when the box was deselected.
Any help would be greatly appreciated, but my knowledge is very limited so
explanations need to be one step at a time!
Many thanks.


--

Dave Peterson


--

Dave Peterson


All times are GMT +1. The time now is 12:55 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com