excel - Disable checkboxes when sheet opened in vba -
i have 3 checkboxes. when user opened sheet, he/she must not check checkboxes. want them disabled. how can that?
not sure if meant activex or formcontrol, here go
code
private sub worksheet_activate() dim myactivex object set myactivex = sheet1.oleobjects("checkbox1") myactivex.object.value = true myactivex.object.locked = false ' make false if wish enable myactivex.object.enabled = false ' option disable dim myformcontrol checkbox set myformcontrol = activesheet.shapes("check box 1").oleformat.object myformcontrol.value = true myformcontrol.enabled = false ' make true if wish enable end sub
Comments
Post a Comment