View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
T-容x[_55_] T-容x[_55_] is offline
external usenet poster
 
Posts: 1
Default Freezing the top line of a sheet with visual basic


Hi jjfjr! I tried the code you gave below and it didn't issue an error.
But, it froze the wrong panes - the panes above and to the left of cell
G18.
If you want to freeze rows and/or columns, select the cell directly
below the specified rows and to the right of the specified columns.
Example, if you want to freeze row 1 and column A, you select, cell B2,
which is directly below row 1 and to the right of column A. Then,
FREEZE!

Worksheets("Sheet3").Activate
Worksheets("Sheet3").Range("B2").Select
ActiveWindow.FreezePanes = True


jjfjr Wrote:
Hi;

I have a workbook with three sheets - Search Form, Results and Data
Table.
The search form allows the user to type in information into one of ten
fields. Each field is aasociated with a column in the data table ; any
hits
go into the results sheet. The header row of the data table goes in as
the
top row of the results sheet. I'd like to freeze the results top row so
that
when someone scrolls through, the top row stays on top so the user can
see
the column descriptions. Also. I'd like to have the header row of the
results
sheet print out no matter where the user has scrolled to.

I saw the following code in another post but it gave me a "run-time
error 9:
subscript out of range" error; the second line was indicated as the
culprit:


Worksheets("Sheet3").Activate
Sheet3.Range("A1:J1").Select
ActiveWindow.FreezePanes = True


Any help is greatly appreciated.
--
JJFJR



--
T-容x
------------------------------------------------------------------------
T-容x's Profile: http://www.excelforum.com/member.php...o&userid=26572
View this thread: http://www.excelforum.com/showthread...hreadid=401601