ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   A check box to open and close Columns (https://www.excelbanter.com/excel-programming/394838-check-box-open-close-columns.html)

Steved

A check box to open and close Columns
 
Hello from Steved

Below I can put in a tick in the CheckBox and it will open the hidden
columns take the tick out and it will close. It is fine on my Computer. My
issue is when I email to a client it will not operate. What do I need to do
please to allow this function. I thankyou.

Private Sub CheckBox1_Click()
Dim r As Range
Set r = Range("K1:L1,N1:O1,Q1:R1,T1:U1,W1:X1,Z1:AA1,AC1:AD 1,AF1:AG1")
r.EntireColumn.Hidden = Not r.EntireColumn.Hidden
End Sub


OssieMac

A check box to open and close Columns
 
The other person may have macros disabled. To enable macros:-

xl2007: Click on large Microsoft Office button top left of screen. Select
Excel Options towards bottom right of screen- Trust Center- Trust Center
Settings- Macro Settings and set option to Disable with notification. The
user will get a dialogue warning box in which they have to select allow the
macro to run.

Earlier versions of xl: Select Tools- Macro- Security - Security Level
tab and set to medium. User will get a warning dialogue box as above.

Regards,

OssieMac


"Steved" wrote:

Hello from Steved

Below I can put in a tick in the CheckBox and it will open the hidden
columns take the tick out and it will close. It is fine on my Computer. My
issue is when I email to a client it will not operate. What do I need to do
please to allow this function. I thankyou.

Private Sub CheckBox1_Click()
Dim r As Range
Set r = Range("K1:L1,N1:O1,Q1:R1,T1:U1,W1:X1,Z1:AA1,AC1:AD 1,AF1:AG1")
r.EntireColumn.Hidden = Not r.EntireColumn.Hidden
End Sub


Steved

A check box to open and close Columns
 
Hello OssieMac from Steved

Than kyou.

"OssieMac" wrote:

The other person may have macros disabled. To enable macros:-

xl2007: Click on large Microsoft Office button top left of screen. Select
Excel Options towards bottom right of screen- Trust Center- Trust Center
Settings- Macro Settings and set option to Disable with notification. The
user will get a dialogue warning box in which they have to select allow the
macro to run.

Earlier versions of xl: Select Tools- Macro- Security - Security Level
tab and set to medium. User will get a warning dialogue box as above.

Regards,

OssieMac


"Steved" wrote:

Hello from Steved

Below I can put in a tick in the CheckBox and it will open the hidden
columns take the tick out and it will close. It is fine on my Computer. My
issue is when I email to a client it will not operate. What do I need to do
please to allow this function. I thankyou.

Private Sub CheckBox1_Click()
Dim r As Range
Set r = Range("K1:L1,N1:O1,Q1:R1,T1:U1,W1:X1,Z1:AA1,AC1:AD 1,AF1:AG1")
r.EntireColumn.Hidden = Not r.EntireColumn.Hidden
End Sub



All times are GMT +1. The time now is 09:02 AM.

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