Auto Freeze Panes Macro. To freeze column a and row 1 at the same time select column b2 navigate to view freeze panes freeze panes. What this vba code does.
You first have to remove the current freeze pane and then turn it back on to your new preferred location. Sub freeze panes first ensure that no panes are frozen activewindow freezepanes false select the row that you want to freeze based on rows 3 3 select freeze panes activewindow freezepanes true end sub. As soon as you understand how many rows are within the knowledge set you ll be able to conditionally set the freeze pane command by deciding on the row beneath the required cell.
What this vba code does.
Range b2 select activewindow freezepanes true. You first have to remove the current freeze pane and then turn it back on to your new preferred location. Rows 1 1 select activewindow freezepanes true freeze columns. Range b2 select activewindow freezepanes true.