Thread: ThisWorkbook
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
GS GS is offline
external usenet poster
 
Posts: 364
Default ThisWorkbook

Can you not just place the formula in the cell? Since the sheet is a
template, I assume the user only needs access to specific areas, so you can
protect the formulas using sheet protection. Clear the check in the "Locked"
option of the Protection tab in FORMAT CELLS... for all cells that require
user access. This requires no code.

Here's a formula that does what you want:

=IF(AND($B$3<"",$B$23<""),1-($B$23/$B$3),"")

It will make sure both cells have values, which will prevent a result of 0
(zero). Otherwise, =IF($B$3<"",1-($B$23/$B$3),"")

Regards,
GS