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:

  1. Option Explicit
  2. Sub SetFreezePanes()
  3. ActiveSheet.Range("B5").Select
  4. ActiveWindow.FreezePanes = True
  5. 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.

 

You can find similar Excel Questions and Answer hereunder

1) Here some more advanced range objects and what you can do with the range object in VBA

2) Here a explanation about the global seek function in VBA. Goal Seek is another tool under What If analysis that does a unique function as Scenario Manager.

3) How do I copy a Table from one location to another and retain all formulas, formats and columnwidths?

4) what are the main range object and what can the range objects do in VBA

5) How can I find the count of records that meet multiple conditions in my raw data table?

6) Here some explanations about XPATH. XPath is a syntax for defining parts of an XML document

7) How can I loop through all ActiveX checkboxes in WorkSheet and set them to Unchecked status?

8) How to change desktop background in Excel

9) How can I set up ListBox using VBA to allow users to select multiple values?

10) How to do worksheet protection with VBA in Excel

 

Here the previous and next chapter