two questions


Posted by CM on January 22, 2002 9:56 PM

First, can you attach a macro to a command button that will protect a sheet?

Second, I have 5 cells, (b5:b10) that contain certain figures, then in cells (b12:b26) contain another set of figures, then in cell (b33) it adds all the figures. Is there anyway to write the formula so that it will not add the figures in cells (b5:b10) unless there is an entry in cells (b12:b26). The formula can add cells (b12:b26) without any entries in the above cells but I don't want it add only the top figures without an entry in the lower figures.

Thanks



Posted by anno on January 22, 2002 10:56 PM

cm
for q1 can't help, don't speak vba. sorry.
for q2, array enter(ie. press ctrl+shift+enter simultaneously)=IF(B12:B26,SUM(B5:B10,B12:B26))

Add a command button to your sheet and assign the following code :

Sub Protect()
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
End Sub

Bruno
-----