Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Freezepanes

Status
Not open for further replies.
Jun 18, 2001
3
US
I am creating an Excel spreadsheet through a module in Access. I am formatting using code as well. I was wondering if anyone knew how to develop a freezpane for my first row which is all Column headers. Does anyone know the code for this?
 
I know, this is at least 3 years late...But maybe someone else needs an answer like I did today.

Dim objXL, objXLSheet as Object

Set objXL = CreateObject("Excel.Application")
objXL.Visible = True
objXL.Workbooks.Add
Set objXLSheet = objXL.Activeworkbook.Sheets("Sheet1")
' Populate the sheet, etc.
With objXLSheet

' Choose one of the following:

' Freeze rows above 3, and left 3 columns.
.Range("D3").Select
objXL.ActiveWindow.FreezePanes = True

' To freeze just row above 2.
.Range("A2").Select
objXL.ActiveWindow.FreezePanes = True

' or to freeze just leftmost column.
.Range("B1").Select
objXL.ActiveWindow.FreezePanes = True
End With

Better late than never. Ken
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top