Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,388
Default Freeze panes

Hi,
I used the macro recorder when freezing panes, and it returned the following:

Range("A8").Select
ActiveWindow.FreezePanes = True

Is there a VBA way to tell Excel where to freeze, without selecting the cell?
eg: ActiveWindow.FreezePanes, Range("A8")
The above example errors, but is there a syntax for this?

Regards - Dave.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default Freeze panes

You would have to use the Split property in conjunction with the FreezePanes
property. See the VBA help file for Freeze Panes and Split for more details.

"Dave" wrote:

Hi,
I used the macro recorder when freezing panes, and it returned the following:

Range("A8").Select
ActiveWindow.FreezePanes = True

Is there a VBA way to tell Excel where to freeze, without selecting the cell?
eg: ActiveWindow.FreezePanes, Range("A8")
The above example errors, but is there a syntax for this?

Regards - Dave.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Freeze panes

I think that setting that location is one of the rare things where you have to
select the cell first.



Dave wrote:

Hi,
I used the macro recorder when freezing panes, and it returned the following:

Range("A8").Select
ActiveWindow.FreezePanes = True

Is there a VBA way to tell Excel where to freeze, without selecting the cell?
eg: ActiveWindow.FreezePanes, Range("A8")
The above example errors, but is there a syntax for this?

Regards - Dave.


--

Dave Peterson
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Freeze panes

ps.

I'll use:

with worksheets("somesheetname")
.select
.range("A1").select 'to make sure it's visible
.range("a8").select 'to position for the freezepanes
activewindow.freezepanes
end with

Otherwise, I may not see all the header rows.

Dave Peterson wrote:

I think that setting that location is one of the rare things where you have to
select the cell first.

Dave wrote:

Hi,
I used the macro recorder when freezing panes, and it returned the following:

Range("A8").Select
ActiveWindow.FreezePanes = True

Is there a VBA way to tell Excel where to freeze, without selecting the cell?
eg: ActiveWindow.FreezePanes, Range("A8")
The above example errors, but is there a syntax for this?

Regards - Dave.


--

Dave Peterson


--

Dave Peterson
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,388
Default Freeze panes

Thanks Dave.
I've found freeze panes a bit of a pain in other ways too, such as cutting
off comments from cells in the frozen part of the sheet.
eg, freeze Column A, then write a comment into A1, then scroll a few columns
across, then try to read the comment in A1.
Regards - Dave.
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel 2003 freeze panes won't freeze top row only macbone2002 Excel Discussion (Misc queries) 3 April 22nd 23 02:07 AM
Freeze Panes Dave Excel Discussion (Misc queries) 5 May 27th 09 09:41 AM
Freeze 2 Panes jordanpcpre Excel Discussion (Misc queries) 6 April 16th 09 08:36 PM
Freeze Panes sjm cpa Excel Worksheet Functions 8 September 13th 08 02:00 AM
Freeze panes Sharaf Excel Discussion (Misc queries) 1 August 25th 08 10:06 AM


All times are GMT +1. The time now is 10:59 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"