vba freeze range in Excel
Q200. In Excel, how can I set FreezePanes in a certain range using VBA?
For example, I want to set Freeze Panes in Range("B5") in my WorkSheet - how can I do so using VBA?
To do it in Excel, here is the answer:
- Option Explicit
- Sub SetFreezePanes()
- ActiveWindow.FreezePanes = True
- End Sub
a) Line 3 - select the cell to the left and above of which the screen should be kept in view always.
b) Set Freeze Panes at the selected cell.