We help IT Professionals succeed at work.
Get Started

VB6 & Excel - Autofilter and freeze panes

Last Modified: 2008-01-09
Generating a spreadsheet via code.
Spreadsheet builds fine.  After the data is inserted, I run some formatting.
The data is inserted into two sheets, xlSheetFull and xlSheetShort.  The Short sheet is a summary listing, with some of the fields left out.

With xlSheetFull
            .Cells(1, 1).Font.Bold = True
            .Cells(1, 2).Font.Bold = True
            .Cells(1, 1).Font.Size = 14
            .Cells(1, 1).Font.Size = 12
            .Range("a2:ae2").Font.Bold = True
            .Range("p2:ae2").Orientation = 90
            .Range("f3:f" & lRow).NumberFormat = "dd/mm/yyyy"
            .Range("n3:n" & lRow).NumberFormat = "dd/mm/yyyy"
            .Range("o3:o" & lRow).NumberFormat = "dd/mm/yyyy"
End With

Now, I want to freeze panes and get an autofilter on.
The column headings are in row 2

I can't seem to figure out the syntax to freeze the panes below row 2, and turn on the filter buttons in row 2.  Especially grateful if it can be fitted in between the With..end with

Watch Question
This problem has been solved!
Unlock 1 Answer and 3 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE