LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Locked problem when using .Clear

After you clear the cells, the cells go back to having the Normal style.

So you have a couple of choices.

#1. range("AP1:AP1500").clearcontents 'leave formatting alone
or
#1A. range("AP1:AP1500").value = "" 'formatting untouched here, too

or

#2. change the Normal style for this workbook.

In xl2003 menus:
Format|Style...
select Normal
Uncheck the Locked checkbox.

Remember that Styles live in workbooks. You'll have to change the Normal style
in any workbook where you need this ability.

Isis wrote:

I am using the following to Clear a group of cells;
Range("AP1:AP1500").Clear

however, after using this code I notice that the cells are Locked rather
than Unlocked as they were originally - this then causes problems in other
code I have running as the sheet is protected when distributed.

Is there something elase I can do to solve the problem ?

Thanks


--

Dave Peterson
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Locked for editing problem... DanF Excel Discussion (Misc queries) 1 July 4th 08 08:28 PM
Problem with locked file Alan M Excel Programming 1 January 25th 08 11:20 PM
Locked for editing problem Alan M Excel Programming 4 January 25th 08 07:50 PM
problem with Locked always on after pasting Janusz Excel Programming 0 February 5th 07 03:27 PM
Locked Cells Problem... Dermot Excel Programming 3 March 7th 06 09:26 PM


All times are GMT +1. The time now is 10:33 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"