Locking a cell in vba excel -



Locking a cell in vba excel -

i want lock cell in vba excel. read previous answers , used them. cell not lock.!!!! code:

number = range("a1") if number < 5 cells(1, 1).locked = true else cells(1, 1).locked = false end if

after subroutine runs cells(1,1) not protected.

locked cell become protected when switch protection worksheet. need add

cells(1, 1).worksheet.protect

that makes locked cells protected (see example).

p.s. default cells are locked

excel-vba

Comments

Popular posts from this blog

xslt - DocBook 5 to PDF transform failing with error: "fo:flow" is missing child elements. Required content model: marker* -

mediawiki - How do I insert tables inside infoboxes on Wikia pages? -

SQL Server : need assitance parsing delimted data and returning a long concatenated string -