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

php - How to pass multiple values from url -

database - php search bar when I press submit with nothing in the search bar it shows all the data -

ios - How to load .png images from Documents folder of an app -