Unfortunately this does not work either - no cells get locked (however, see below).

If I change .Borders.ColorIndex = xlNone to .Borders.ColorIndex = 16, the the following behaviour is observed:
  • In 2007 the code still does not lock any cells/mergeareas, regardless of their colour.
  • In 2010 it locks some cells/mergeareas, but not others, and also does not unlock some cells/mergeareas after they have been locked the first time - it all seems to be getting applied inconsistently.

For example, it locks K64:L64, but not K65:L65. It also locks all of the cells/mergeareas in the Combined Fund Heading 'table' (F125:W137), but does not Unlock them when they should be available (set F10 to "Standard Proposal (Research)" and L89 to either "FEC" or "Non-FEC").

In addition, the code takes an excessive amount of time (>2 minutes) to execute in 2007, causing Excel to become non-responsive (even being reported in task manager as 'Not Responding') during that period.