VBA Code to Lock Range & Cells in Excel


  • Dear All !! I have one Excel 2010 File. I want some Ranges and some indivisual cells as ReadOnly but rest of the file should remain editable. These read ReadOnly Ranges & cells should hide the formula as well, as I want the result should be displayed but not the formula. I have done that one through Excel Menu Command but it does not match with my requirement. Following are the details of the Colum, Rows & Cells which required VBA Codes for the above actions:

    Row                                                  90                Cell                                                 K98

    Cell                                                 C133              Cell                                                 C135

    Column         Range.......                  C95:C125       Column         Range......                   D96:D125

    Column         Range......                   G95:G125       Column        Range......                    H95:H125

    Column         Range......                   H130:H131      Column        Range......                   H133:H135

    Thanks!............ Kahn-Cann               


    Monday, September 24, 2012 9:37 PM



    this worked for me.

    Please do not forget to click “Vote as Helpful” if the reply helps/directs you toward your solution and or "Mark as Answer" if it solves your question. This will help to contribute to the forum.

    Monday, September 24, 2012 9:49 PM