i creating checklist , don't want able edit anything. sheet updates upon double click in relevant cell. works , have working in protected state, can't find on how make work in protected , shared state.
i tried activesheet.protectsharing didn't work.
private sub worksheet_beforedoubleclick(byval target range, cancel boolean) activesheet.unprotectsharing "h:\finance\controls\checklist\daily checklist\" & format(now, "yyyy") & "\" & format(now, "mm - mmmm yy") & _ "\" & "finance daily checklist " & format(now, "dd mmm") & ".xlsm", "checklist" 'limit target count 1 if target.count > 1 exit sub 'isolate target specific range if intersect(target, range("ckboxes")) nothing exit sub 'set target font "marlett" target.font.name = "marlett" 'check value of target if target.value <> "a" target.value = "a" 'sets target value = "a" target.offset(0, 2).value = environ("username") target.offset(0, 1).value = format(now, "hh:mm:ss") target.offset(0, 3).value = format(now, "dd-mm-yyyy") cancel = true activesheet.protectsharing "h:\finance\controls\checklist\daily checklist\" & format(now, "yyyy") & "\" & format(now, "mm - mmmm yy") & _ "\" & "finance daily checklist " & format(now, "dd mmm") & ".xlsm", "checklist" exit sub end if if target.value = "a" cancel = true activesheet.protectsharing "h:\finance\controls\checklist\daily checklist\" & format(now, "yyyy") & "\" & format(now, "mm - mmmm yy") & _ "\" & "finance daily checklist " & format(now, "dd mmm") & ".xlsm", "checklist" exit sub end if end sub
Comments
Post a Comment