Forum Discussion

Tjalle's avatar
Tjalle
Copper Contributor
Feb 05, 2019

Error1004 Can you help me with this pleace. Its only happens when the sheet is locked

Sub Dölj()
'
' Dölj Makro
'

'
Columns("E:H").Select
Selection.EntireColumn.Hidden = True
Rows("22:24").Select
Range("A24").Activate
Selection.EntireRow.Hidden = True
Range("A14").Select
End Sub
Sub Tafram()
'
' Tafram Makro
'

'
Columns("e:h").Select
Selection.EntireColumn.Hidden = False
Rows("21:26").Select
Selection.EntireRow.Hidden = False
Range("E5").Select
End Sub

  • Rich99's avatar
    Rich99
    Iron Contributor

    You have some cells locked in columns E:H so when the sheet is protected you cannot change anything. Easy way is unprotect the sheet in the macro then re-protect it when macro is completed

    • Tjalle's avatar
      Tjalle
      Copper Contributor

      Thank you for answer.

      I'ts stange! When i protect the sheet its possible to run one of the tree macros but not the other two.

Resources