ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   using macros to insert and remove calculations a the workbook (https://www.excelbanter.com/excel-programming/367984-using-macros-insert-remove-calculations-workbook.html)

holy41

using macros to insert and remove calculations a the workbook
 
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.

Jim Thomlinson

using macros to insert and remove calculations a the workbook
 
And the question is???
--
HTH...

Jim Thomlinson


"holy41" wrote:

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.


holy41

using macros to insert and remove calculations a the workbook
 
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

"Jim Thomlinson" wrote:

And the question is???
--
HTH...

Jim Thomlinson


"holy41" wrote:

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.



All times are GMT +1. The time now is 11:22 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com