+ Reply to Thread
Results 1 to 3 of 3

freeze pane in VBA

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    05-09-2013
    Location
    Chicago
    MS-Off Ver
    Excel 2016
    Posts
    543

    freeze pane in VBA

    In the attached spreadsheet I am having trouble trying to put a line in that will freeze row 4, so when the user navigates that row always will display. Thank you.

     Sub Classify()
    Dim rngCell As Range
    Dim wsLookUp As Worksheet
    
    
            '  Reformat annovar
    
        Range("AK1:BB1").Value = Array("Index", "Deleted", "Gene", "mRNA", "Deleted", "Deleted", "Coverage", _
                                       "Score", "A(#F,#R)", "C(#F,#R)", "G(#F,#R)", "T(#F,#R)", "Ins(#F,#R)", _
                                       "Del(#F,#R)", "SNP", "Mutation", "Frequency", "AminoAcid")
    
        Range("AL:AL, AO:AP").EntireColumn.Delete
    
        Range("AK:AY").Copy
        Range("A1").Insert
    
        Range("AP:BN").EntireColumn.Delete
    
        Range("AP1:AW1").Value = Array("Homopolymer", "Splice", "Pseudogene", "Classification", "HGMD", _
                                       "Disease", "References", "Sanger")
    
    
        Columns(3).Insert xlRight
    
        Range("C1").Value = "Inheritance"
    
        Range("1:3").Insert xlShiftDown
    
        With Range("A1:F1")
            .Value = Array("Case", "Last Name", "First Name", "Medical Record", "Gender", "Panel", "")
            .Resize(2).Interior.ColorIndex = 6
        End With
        
    Range("A4:AX4").Select
    Selection.Columns.AutoFit
    
        '  Step 2 Select Patient
     Application.ScreenUpdating = False
        With ActiveSheet
            lastrow = Cells(.Rows.Count, "CA").End(xlUp).Row
        With Selection.Validation
            End With
            With .Range("A2").Validation
                .Delete
                .Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _
                     xlBetween, Formula1:="=$CA$5:$CA$" & lastrow
                .IgnoreBlank = True
                .InCellDropdown = True
                .InputTitle = ""
                .ErrorTitle = ""
                .InputMessage = ""
                .ErrorMessage = ""
                .ShowInput = True
                .ShowError = True
            End With
        End With
        Application.ScreenUpdating = True
    
       
    End Sub
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: freeze pane in VBA

        Rows("5:5").Select
        ActiveWindow.FreezePanes = True
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  3. #3
    Forum Contributor
    Join Date
    05-09-2013
    Location
    Chicago
    MS-Off Ver
    Excel 2016
    Posts
    543

    Re: freeze pane in VBA

    thank you

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Freeze pane
    By BadgerMK in forum Excel General
    Replies: 0
    Last Post: 09-14-2006, 09:11 AM
  2. [SOLVED] Freeze pane
    By Nick London in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-04-2006, 07:10 AM
  3. Freeze pane
    By Marisa in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-11-2006, 07:55 AM
  4. Freeze pane
    By kevin in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 01-28-2005, 11:06 AM

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