PocketLoan
PocketLoan

Reputation: 532

Dynamic Frozen Panes Titles

So In excel I have been asked to change an excel file to incorporate dynamic titles above the frozen pane. The idea is that the header says January since it is the first month, but when the user scrolls into the February data the title should change to February.

I have tried to start writing a macro that does this , but the closest I could get was making the frozen pane header a drop down, searching for the contents of the header cell and making the first cell in the column below the header which contains the actual month being shown and I'm having trouble getting this to work; I can't debug my syntax. Help would be great! I think if I can get the dropdown selection to be the basis of a search that makes the first instance of the search criteria in the column below the currently active cell and then scroll so that it is located just below the frozen pane.

Range("E1").Select
Dim selekt As Variant
selekt = Range("E1").Select
Selection.Copy (selekt)
Cells.Find(What:=selekt, After:=abc, LookIn:=xlFormulas, _
    LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
    MatchCase:=False, SearchFormat:=False).Activate

Upvotes: 0

Views: 311

Answers (2)

Matt
Matt

Reputation: 503

Please check my answer to a similar issue here Dynamic Freeze Pane / Frozen Row in Excel

You can freeze the first 2 rows in your workbook and change them in the same manner as I did.

Upvotes: 1

Monty Wild
Monty Wild

Reputation: 4001

Have a look at Window.VisibleRange. You would still have to get an event to fire, though.

Upvotes: 1

Related Questions