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
Post a Comment