+ Reply to Thread
Results 1 to 5 of 5

Protecting forumla in VBA

  1. #1
    Valued Forum Contributor
    Join Date
    01-10-2011
    Location
    swindon, england
    MS-Off Ver
    Excel 2010
    Posts
    317

    Protecting forumla in VBA

    Hi

    Does anyone know how to protect a worksheet so that it does not show the forumla within the cells in VBA?

    have been using
    Please Login or Register  to view this content.
    but its not doing anything as when you use the workbook it dose not ask for a password.

    thanks

    jeskit

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,448

    Re: Protecting forumla in VBA

    you mention worksheet but your code is using the activeworkbook

    what exactly are you trying to do and have you tried using the macro recorder?
    Cheers
    Andy
    www.andypope.info

  3. #3
    Valued Forum Contributor
    Join Date
    01-10-2011
    Location
    swindon, england
    MS-Off Ver
    Excel 2010
    Posts
    317

    Re: Protecting forumla in VBA

    Hi

    Thank you for replying

    sorry what i meant was that the macro is one worksheet and the the macro is opening anotehr macro which has forumla within in and my code pastes data into the workbook and then i want it to protect forumla. I have been told there is a way to protect the forumla so when you click the cell with the formula it doesn't show the forumla but i have no idea how to do that.

    The code i put in my orginal post is what i am using but it doesn't seem to work as i want to password protect the workbook teh macro opens.

    does that make sense?

  4. #4
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,448

    Re: Protecting forumla in VBA

    maybe you type too quickly...
    the macro is one worksheet and the the macro is opening anotehr macro
    If you display the cells format dialog you will see on the Protection tab you can have the contents of the cell Hidden. This will stop the formula displaying in the formula bar.

    Once you have set the Hidden property you need to protect the worksheet.

    And if you want you can then protect the workbook, but that will have no effect until the workbook is closed and reopened.

    Please Login or Register  to view this content.

  5. #5
    Valued Forum Contributor
    Join Date
    01-10-2011
    Location
    swindon, england
    MS-Off Ver
    Excel 2010
    Posts
    317

    Re: Protecting forumla in VBA

    Hi

    Thanks works perfectly.....Thank you for help i appraciate it

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1