using macros to insert and remove calculations a the workbook

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am using macros to address formulas in certain cells of a workbook. I am
trying to find a way to clear those formulas (tried Workbook_BeforeClose) so
that if my workbook is copied, and then macros are disabled, my work will not
be displayed.
I use a dongle with a code-checking macro for security on the workbook, but
if you copy the book and disable macros, the book still functions and all the
formulas are left in the cells.
 
the question is - what format do i use to clear the formula from the cell?
I have tried:
sub Workbook_BeforeClose
range("B9").formula.select
selection.clearcontents
activeworkbook.save
end sub

but this doesn't work. the formula is still left in the cell when i open the
workbook again with macros disabled
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top