Hi all,
Can anyone show me how to use Freeze Pane by Excel macro?
Thanks.
Hi all,
Can anyone show me how to use Freeze Pane by Excel macro?
Thanks.
Hi there:
Try this.
RegardsSub Macro1() 'remove any previous freezing ActiveWindow.FreezePanes = False 'Select the cell you want to start your freezing ActiveWorkbook.Sheets("Sheet1").Range("B5").Activate 'apply freezing ActiveWindow.FreezePanes = True End Sub
Mac
Thanks. macb.
You had made this thread solved.
Can we just freeze only vertical or horizontal only?
Thanks
Just selct column A or row 1 for this.Originally Posted by sheeeng
Can show some code example?Originally Posted by xld
Thx!
Originally Posted by sheeeng
Sub Macro1() 'remove any previous freezing ActiveWindow.FreezePanes = False 'Select the cell you want to start your freezing 'with no columns frozen ActiveWorkbook.Sheets("Sheet1").Range("A5").Activate 'apply freezing ActiveWindow.FreezePanes = True End Sub Sub Macro1() 'remove any previous freezing ActiveWindow.FreezePanes = False 'Select the cell you want to start your freezing 'with no rows frozen ActiveWorkbook.Sheets("Sheet1").Range("B1").Activate 'apply freezing ActiveWindow.FreezePanes = True End Sub
Thx. Initially I thought that there are no differnces btw above codes.Originally Posted by xld
But after I run it, I realized that the FreezePane is much depended on location of the cell.
If the cell is uppermost part of the sheet, it will freeze pane vertically.
If the cell is leftmost part of the sheet, it will freeze pane horizonly.
Am I right of these two statements?
Thanks.
That's about rightOriginally Posted by sheeeng
Thank you, xld.
You are really a helping hand at this forum.
Thanks again.