Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
lock cells
Hi,
I have an information in cells D1:J10. This information will be updated and added . It means that number of row can be change any time. When program is running I use command: Worksheets("sheet1").Columns.Clear To save this info I tried to lock that column before Clear: Worksheets("sheet1").Range("D1:J10").Locked = True , but it is doesn't help. How can I save info in that columns. Thanks' |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
lock cells
The Locked property only applies when the worksheet is protected. If the
worksheet was protected then your Columns.Clear command would result in an error. You need to think about why you are running the line of code: Worksheets("sheet1").Columns.Clear which clears all data on the sheet. You obvioulsy don't want to do that so you should determine what range of cells you do want to clear and direct the macro to just that range. E.g if you only want to clear columns A to C then: Worksheets("sheet1").Columns("A:C").Clear Hope this helps Rowan " wrote: Hi, I have an information in cells D1:J10. This information will be updated and added . It means that number of row can be change any time. When program is running I use command: Worksheets("sheet1").Columns.Clear To save this info I tried to lock that column before Clear: Worksheets("sheet1").Range("D1:J10").Locked = True , but it is doesn't help. How can I save info in that columns. Thanks' |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Can't lock cells | Excel Discussion (Misc queries) | |||
Lock Cells | Excel Discussion (Misc queries) | |||
lock cells | New Users to Excel | |||
Lock Cells | Excel Discussion (Misc queries) | |||
lock used cells | Excel Discussion (Misc queries) |