Results 1 to 6 of 6

Freeze top row in vba

Threaded View

  1. #1
    Forum Contributor
    Join Date
    12-01-2007
    Location
    USA-North Carolina
    MS-Off Ver
    MS Office 2016
    Posts
    2,712

    Freeze top row in vba

    hi, i am trying to freeze the top row of a given worksheet. I recorded a macro to see how to do it and this is what it gives me.

        With ActiveWindow
            .SplitColumn = 0
            .SplitRow = 1
        End With
        ActiveWindow.FreezePanes = True

    I replaced the "activewindow" with

    workbooks(fl_name).worksheets(1)

    but it does not work.


    So i used this


    fl_name = ThisWorkbook.Name
    
    Set ws1 = Workbooks(fl_name).Worksheets("Quality Compliance")
        
        ws1.Rows("1:1").Select
        With ActiveWindow
            .SplitColumn = 0
            .SplitRow = 1
        End With
        ActiveWindow.FreezePanes = True
    While this did work.........froze top row............but it also split the top row. So i could not simply unfreeze the top row.


    Is there a better way to freeze the top row?
    Last edited by welchs101; 02-17-2012 at 09:12 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1