Are grouped cells created via Data|group or Data|Subtotal?
If yes, you can protect the worksheet in code...
But this setting isn't remembered between closing/reopening the workbook. (So
Auto_open is a nice spot for it.)
Option Explicit
Sub auto_open()
Dim wks As Worksheet
Set wks = Worksheets("sheet1")
With wks
.Protect Password:="hi", userinterfaceonly:=True
.EnableAutoFilter = True
'or
.EnableOutlining = True
End With
End Sub
EnableAutofilter/enableoutlining--depending on what you mean by grouped.
And autofilter or the outlining has to be applied beforehand.