Put the following code in the ThisWorkBook section of your VBA Project :
[pre]
Code:
Public Sub freeze_panes()
Worksheets("Sheet1").Activate ' Change this to whatever you want
ActiveWindow.Split = False
Range("M3").Select ' Change this to whatever you want
ActiveWindow.FreezePanes = True
End Sub