#1   Report Post  
Posted to microsoft.public.excel.programming
joe joe is offline
external usenet poster
 
Posts: 62
Default Freeze pane

Hi,

How can VBA be coded to specify a particular row that can
freeze pane? also, how can using the ".clear" method code
that will delete the unwanted cell(in row) that is not
required?

regards,
Joe
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Freeze pane

Hi Joe,

To split the active workbook at (say) row 2, try:

Sub Tester()

With ActiveWindow
.SplitColumn = 0
.SplitRow = 2
.FreezePanes = True
End With
End Sub

Adjust the row (and column) number to suit.

To remove the split ,

Sub Unsplit()

With ActiveWindow
.SplitColumn = 0
.SplitRow = 0
End With
End Sub

To delete the contents of a cell:

Range("A2").ClearContents

To delete the contents of a cell and remove its formatting:

Range("A2").Clear


---
Regards,
Norman



"Joe" wrote in message
...
Hi,

How can VBA be coded to specify a particular row that can
freeze pane? also, how can using the ".clear" method code
that will delete the unwanted cell(in row) that is not
required?

regards,
Joe



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Freeze pane

Just some added info:
Freezepanes and split are two different approaches to a similar problem.
While Norman's code does accomplishe the intended purpose, if you then
unfreeze the window, you see that a split is also applied (freezepanes
appears to take precedence). Another way to apply a freezepane at row 2
without doing a split would be to select either row(3) or cell A3

Range("A3").Select
With ActiveWindow
.FreezePanes = True
End With

and to unfreeze

With ActiveWindow
.FreezePanes = False
End With

--
Regards,
Tom Ogilvy



"Norman Jones" wrote in message
...
Hi Joe,

To split the active workbook at (say) row 2, try:

Sub Tester()

With ActiveWindow
.SplitColumn = 0
.SplitRow = 2
.FreezePanes = True
End With
End Sub

Adjust the row (and column) number to suit.

To remove the split ,

Sub Unsplit()

With ActiveWindow
.SplitColumn = 0
.SplitRow = 0
End With
End Sub

To delete the contents of a cell:

Range("A2").ClearContents

To delete the contents of a cell and remove its formatting:

Range("A2").Clear


---
Regards,
Norman



"Joe" wrote in message
...
Hi,

How can VBA be coded to specify a particular row that can
freeze pane? also, how can using the ".clear" method code
that will delete the unwanted cell(in row) that is not
required?

regards,
Joe





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
FREEZE PANE Freeze Pane Excel Discussion (Misc queries) 2 April 9th 09 02:53 AM
freeze pane Atishoo Excel Discussion (Misc queries) 3 July 11th 08 08:33 PM
freeze pane: freeze from two worksheets? Chris Excel Discussion (Misc queries) 4 May 27th 08 01:17 AM
Freeze pane CraigMc Excel Discussion (Misc queries) 2 September 5th 05 02:48 PM
Freeze pane kevin Excel Worksheet Functions 0 January 28th 05 02:05 PM


All times are GMT +1. The time now is 12:52 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"