I am in a very strange situation in VBA. I am new to VBA and struggling since a couple of days in solving this problem.
I want to Lock the top three rows and the first three columns of my excel sheet for editing. However, these cells contain formulas, which I don't want the end user to edit and make changes. So basically, what I need is, the cells should perform all the operations, but should not be edited. How can, I do it in VBA. I am using Excel 2010.
One more thing, I have a button in the top rows ($B$2:$C$3)
occupying four cells. This button is assigned to a macro which does the job of clearing contents in all the cells except the cell I Intend to lock. In short, in the other cells, the user can export data from a notepad and thereafter the formulas in the locked cell will do the job. When the user has to export new set of datas, he will cick on the button which is in ($B$2:$C$3)
, which clears the existing data and the user can imprt new set of dat from the notepad.
When I use
Worksheets("Sheet1").Range("B2:C3").Locked = False
Worksheets("Sheet1").Protect UserInterfaceOnly:=True
my button in ($B$2:$C$3)
is not working properly. Any help from anybody will behighly solicited. Thanks a lot in advance.