excel - VBA cells are not highlighted -
its protected worksheet/workbook , have code throw prompt user, whether edit sheet or not. cells editable, problem cells not getting highlighted border. difficult user know cells working on.
i have 2 sheets here, corefiller , ad-filler, if dropdown on corefiller sheet "no". user gets prompt when selects sheet, clicks ok edit sheet or cancel if doesnt want edit.
code on sheet "ad-filler"
option explicit private mmessagedisplayed boolean private sub worksheet_activate() carry end sub
code on module.
public sub carry() if activesheet.protectcontents , not mmessagedisplayed mmessagedisplayed = true if thisworkbook.sheets("corefiller").range("e29") = "no" if msgbox("click ok include filler request", vbokcancel + vbinformation) = vbok thisworkbook.worksheets("corefiller").range("e29") = "yes" thisworkbook.sheets("ad-filler") .range("e13:e14").locked = false end else thisworkbook.sheets("ad-filler") .range("e13:e14").locked = true end end if else exit sub end if end if end sub
whats wrong in code? why cell not highlighted. if try use protect/unprotect in code, cells on first sheet (corefiller) not highlighted , have click on other sheets , come cell highlighted.
can restart, implement , check whether problem still exists:
private sub worksheet_selectionchange(byval target range) cells.interior.colorindex = 0 target.interior.colorindex = 3 end sub
Comments
Post a Comment