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

Copper Contributor

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

2 Replies

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

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.