Results 1 to 3 of 3
  1. #1
    3 Star Lounger siflaar's Avatar
    Join Date
    Jan 2001
    Location
    Amersfoort, Netherlands
    Posts
    203
    Thanks
    4
    Thanked 0 Times in 0 Posts

    lock on merged cells (NL XL 2003)

    Hello All,

    I have some merged cells in my sheet and they have there own name.
    The strange thing is that when select the cell en change the properties to locked = true it is all okay,
    but when I do the same using VBA "range("cellname").locked=true" this gives me an error.
    It seems only to happen with merged cells.

    So to confirm... Am I not able to lock or unlock merged cells by VBA code?

    Thanks for your reactions.
    Greetings,

    Patrick Schouten
    (The Netherlands)

  2. #2
    WS Lounge VIP rory's Avatar
    Join Date
    Dec 2000
    Location
    Burwash, East Sussex, United Kingdom
    Posts
    6,280
    Thanks
    3
    Thanked 191 Times in 177 Posts

    Re: lock on merged cells (NL XL 2003)

    If you check the name definition, does it refer to all the cells that make up the merged area, or just the top left one? If it refers to all of them, then the code should work. (If you named the range using the name box, it probably only refers to the top left cell, and you will get an error)
    Regards,
    Rory

    Microsoft MVP - Excel

  3. #3
    3 Star Lounger siflaar's Avatar
    Join Date
    Jan 2001
    Location
    Amersfoort, Netherlands
    Posts
    203
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Re: lock on merged cells (NL XL 2003)

    You are a livesaver.
    Thanks, you hit the nail on it's head
    Greetings,

    Patrick Schouten
    (The Netherlands)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •