Consulting

Results 1 to 2 of 2

Thread: freeze pan

  1. #1
    VBAX Mentor
    Joined
    Jun 2005
    Posts
    374
    Location

    freeze pan

    hello
    i have a table which i wanted to scroll and keep the headline frozen.
    i came up with this:
    [VBA]
    Sub SelectsecondRowOnly()
    Dim vCols As Integer
    Dim i As Integer
    i = 1
    selection.CurrentRegion.Select
    vCols = selection.Columns.count
    selection.Resize(i + 1, vCols).Select
    ActiveWindow.FreezePanes = True
    End Sub
    [/VBA]
    how can i select the second row of a selection (assuming the first row is the headline) an freeze the window?
    thanks
    moshe

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    [vba]

    Sub SelectsecondRowOnly()
    Selection.CurrentRegion.Offset(1, 0).Resize(1, 1).Select
    ActiveWindow.FreezePanes = True
    End Sub

    [/vba]
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

Posting Permissions

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