none
cannot change part of a merged cell e7:g7 merged RRS feed

  • Question

  • Sub clear()
      Dim a As Long
         For a = 1 To 40
            Worksheets(a).Unprotect Password:="p@$$w0rd"

             Worksheets(a).Range("c7,e7:g7,a10:a45,e10:e45").ClearContents
             Worksheets(a).Protect Password:="p@$$w0rd"
         Next a
     MsgBox "Clear Complete"
     
     End Sub

    Hany Samoil

    Sunday, May 17, 2015 8:06 AM

Answers

  • Are you sure the merged range isn't larger? For example if E7:H7 is merged, Excel won't let you clear E7:G7.

    Regards, Hans Vogelaar (http://www.eileenslounge.com)

    Sunday, May 17, 2015 9:36 AM