Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default Returning reference of frozen cell

I have a spreadsheet in which the Freeze Panes anchor may or may not be in
the right place. How do I write code to check this? I need to put the code
in the selection_change code for the worksheet, so I don't want to unfreeze
and re-freeze every time I change a cell ... just if it is currently frozen
in the wrong place.

Ideally, what I'm trying to do is something like this:

If ActiveWindow.FreezePanes.Row = 1 Then

ActiveWindow.FreezePanes = False
Range("A2").Select
ActiveWindow.FreezePanes = True

End If

....except that "ActiveWindow.FreezePanes.Row" is not a valid expression.

Would appreciate any help! Thanks.

Pete
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Returning reference of frozen cell

Range("A1").Select
if activeWindow.VisibleRange(1).row < 3 then

--
Regards,
Tom Ogilvy


"Pete at Sappi Fine Paper" wrote:

I have a spreadsheet in which the Freeze Panes anchor may or may not be in
the right place. How do I write code to check this? I need to put the code
in the selection_change code for the worksheet, so I don't want to unfreeze
and re-freeze every time I change a cell ... just if it is currently frozen
in the wrong place.

Ideally, what I'm trying to do is something like this:

If ActiveWindow.FreezePanes.Row = 1 Then

ActiveWindow.FreezePanes = False
Range("A2").Select
ActiveWindow.FreezePanes = True

End If

...except that "ActiveWindow.FreezePanes.Row" is not a valid expression.

Would appreciate any help! Thanks.

Pete

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default Returning reference of frozen cell

Tom, you're a genius. Thanks!

"Tom Ogilvy" wrote:

Range("A1").Select
if activeWindow.VisibleRange(1).row < 3 then

--
Regards,
Tom Ogilvy


"Pete at Sappi Fine Paper" wrote:

I have a spreadsheet in which the Freeze Panes anchor may or may not be in
the right place. How do I write code to check this? I need to put the code
in the selection_change code for the worksheet, so I don't want to unfreeze
and re-freeze every time I change a cell ... just if it is currently frozen
in the wrong place.

Ideally, what I'm trying to do is something like this:

If ActiveWindow.FreezePanes.Row = 1 Then

ActiveWindow.FreezePanes = False
Range("A2").Select
ActiveWindow.FreezePanes = True

End If

...except that "ActiveWindow.FreezePanes.Row" is not a valid expression.

Would appreciate any help! Thanks.

Pete

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,073
Default Returning reference of frozen cell

Hi Pete,

If ActiveWindow.Panes.Count = 1 then panes are not frozen.

Ken Johnson

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default Returning reference of frozen cell

Thanks Ken - good to know. My current problem is not whether they are frozen
or not, but *where* they are frozen (for some reason Excel keeps moving the
anchor without provocation, which is most unsportsmanlike). If anyone
happens to know how/why this is occurring, please let me know! I think it's
an application bug though.

"Ken Johnson" wrote:

Hi Pete,

If ActiveWindow.Panes.Count = 1 then panes are not frozen.

Ken Johnson




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
Reference to cell with text is returning #VALUE Jorist Excel Discussion (Misc queries) 6 March 25th 19 08:18 AM
Cell reference returning incorrect value JohnOC Excel Discussion (Misc queries) 2 April 9th 09 02:29 PM
Returning the cell reference when you find a value in an array taylor Excel Worksheet Functions 10 July 2nd 07 04:08 PM
Returning a cell reference with a formula? Hurton Excel Worksheet Functions 13 February 24th 06 11:40 PM
Returning with cell on right/left of a reference Hellion Excel Worksheet Functions 1 June 5th 05 12:22 PM


All times are GMT +1. The time now is 09:22 AM.

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

About Us

"It's about Microsoft Excel"