vba - Excel: How to use a checkbox form marco to hide column on MAC -


i'm using activex checkbox following macro in worksheet:

private sub checkbox1_click() if checkbox1 = true    columns("p:v").hidden = true else    columns("p:v").hidden = false end if end sub 

and works fine on pc. when try on mac, doesn't work since mac doesn't have activex support. tried using regular form control checkbox, doesn't appear function @ when use macro. have ideas? i'm kind of vba/excel noob.

if put 2 forms checkboxes on sheet , name them "cbb" , "cbc" can assign macro below both of them. column affected depend on checkbox triggers sub.

code regular module: if want in sheet module replace activesheet me

sub checkbox_click()      dim vis boolean, ac string, col string      ac = application.caller      activesheet          vis = (.shapes(ac).controlformat.value = 1)          select case ac             case "cbb": col = "b"             case "cbc": col = "c"         end select          if col <> "" .columns(col).hidden = vis      end  end sub 

Comments

Popular posts from this blog

python - Subclassed QStyledItemDelegate ignores Stylesheet -

java - HttpClient 3.1 Connection pooling vs HttpClient 4.3.2 -

SQL: Divide the sum of values in one table with the count of rows in another -