View Single Post
  #9   Report Post  
Posted to microsoft.public.excel.programming
GS[_2_] GS[_2_] is offline
external usenet poster
 
Posts: 3,514
Default Calling module procedure from sheet procedure

I un-merged the cell, set all the cells to unlocked, and then
re-merged them. When I the modify the cell the procedure triggers and
re-formats the merged cell to multi-line.

Normally, if the upper left cell of a group is not locked and that
group gets merged, then all cells in the group become not locked. They
remain not locked when the group is unmerged.

If I then view the properties of the cell on the protection tab the
"locked" box has a square in it (not cleared, not checked).


Not able to duplicate this! Perhaps your workbook is corrupt...

When the sheet protection is put back on I can not select that cell
any more (I'm assuming because of the square status in the Locked
checkbox.


FWIW
I normally 'reset' protection when a workbook with protected sheets is
opened so code can modify locked cells without having to toggle
protection off/on. This is possible by setting the parameter
'UserInterfaceOnly=True', which doesn't persist between sessions. This
combines the best of both features in that users can modify unlocked
cells and code can modify all cells.

Merged cells are typically problematic for code anyway, and so should
be avoided. Not always possible when designing forms and so we have to
use merged cell areas. Regardless, your problem seems to be unique to
the file you're working on and so I recommend rebuilding the project in
a new file!

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion