When you record the macro, do something between freezing and
unfreezing the panes like select a different cell, then you'll get
something like this:
Range("D6").Select
ActiveWindow.FreezePanes = True
Range("F11").Select
ActiveCell.FormulaR1C1 = "33"
Range("F12").Select
ActiveWindow.FreezePanes = False
Range("G12").Select
ActiveWindow.FreezePanes = True