Vba freeze range in Excel
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()
- ActiveSheet.Range("B5").Select
- ActiveWindow.FreezePanes = True
- End Sub
Description:
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.