I have this code that I cut and paste into a workbook, run and then save and close in a macro free workbook. I am trying to set this up as a macro in my personal file to share but keep getting the error above after the activate line. Any ideas as to why I cannot simply just put this as a macro?
Code:
[FONT=Calibri][SIZE=3][COLOR=#000000]Sub FreezePains()
[/COLOR][/SIZE][/FONT][FONT=Calibri][SIZE=3][COLOR=#000000] Dim Sh AsWorksheet
[/COLOR][/SIZE][/FONT][FONT=Calibri][SIZE=3][COLOR=#000000] Application.ScreenUpdating = False
[/COLOR][/SIZE][/FONT][FONT=Calibri][SIZE=3][COLOR=#000000] For Each Sh InThisWorkbook.Worksheets
[/COLOR][/SIZE][/FONT][FONT=Calibri][SIZE=3][COLOR=#000000] With Sh
[/COLOR][/SIZE][/FONT][FONT=Calibri][SIZE=3][COLOR=#000000] .Activate
[/COLOR][/SIZE][/FONT][FONT=Calibri][SIZE=3][COLOR=#000000] .Range("C6").Activate[/COLOR][/SIZE][/FONT]
[FONT=Calibri][SIZE=3][COLOR=#000000] End With
[/COLOR][/SIZE][/FONT][FONT=Calibri][SIZE=3][COLOR=#000000] ActiveWindow.FreezePanes= True
[/COLOR][/SIZE][/FONT][FONT=Calibri][SIZE=3][COLOR=#000000] Next Sh
[/COLOR][/SIZE][/FONT][FONT=Calibri][SIZE=3][COLOR=#000000] ThisWorkbook.Worksheets(1).Activate
[/COLOR][/SIZE][/FONT][FONT=Calibri][SIZE=3][COLOR=#000000] Application.ScreenUpdating = False
[/COLOR][/SIZE][/FONT][FONT=Calibri][SIZE=3][COLOR=#000000]End Sub[/COLOR][/SIZE][/FONT]