Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,574
Default how do I freeze the window with VBA?


--
Brevity is the soul of wit.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default how do I freeze the window with VBA?

Application.ScreenUpdating = False
is what you are looking for ?

"Dave F" wrote:


--
Brevity is the soul of wit.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,574
Default how do I freeze the window with VBA?

Sorry, let me be a little more specific. I recorded a macro, which I
intended to do the following three things:

1) Hide rows 86:120
2) Hide columns AM:CP
3) Freeze the windo at cell J4

This resulted in the following code:

Sub ShowTCAPSfcst()
'
' ShowTCAPSfcst Macro
' Macro recorded 11/17/2006 by df78700
'

' Hides rows 85:120, hides columns AM:CP, and freezes window at J4
Rows("85:120").Select
Selection.EntireRow.Hidden = True
Columns("AM:CP").Select
Selection.EntireColumn.Hidden = True
Range("J4").Select
ActiveWindow.FreezePanes = True
End Sub

I attached this code to a button and started to test it. I noticed that the
frozen cell wouldn't stay at J4. So, is there better code to use, than that
provided by Excel's default macro recorder?

Thanks,

Dave
--
Brevity is the soul of wit.


"pgchop" wrote:

Application.ScreenUpdating = False
is what you are looking for ?

"Dave F" wrote:


--
Brevity is the soul of wit.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default how do I freeze the window with VBA?

ok.
maybe the first question sould be why do you want to hide these columns.
Because you can easily make your calculations on an other sheet and hide the
entire sheet, even with a passord and even "veryhide" the sheet so that the
sheet can not be "unhidden" manually but only using vba...

Sub VeryHideSheet()
Sheets("secret").Visible = xlSheetVeryHidden
End Sub

Sub ShowSheet()
Sheets("secret").Visible = xlSheetVisible
End Sub



"Dave F" wrote:

Sorry, let me be a little more specific. I recorded a macro, which I
intended to do the following three things:

1) Hide rows 86:120
2) Hide columns AM:CP
3) Freeze the windo at cell J4

This resulted in the following code:

Sub ShowTCAPSfcst()
'
' ShowTCAPSfcst Macro
' Macro recorded 11/17/2006 by df78700
'

' Hides rows 85:120, hides columns AM:CP, and freezes window at J4
Rows("85:120").Select
Selection.EntireRow.Hidden = True
Columns("AM:CP").Select
Selection.EntireColumn.Hidden = True
Range("J4").Select
ActiveWindow.FreezePanes = True
End Sub

I attached this code to a button and started to test it. I noticed that the
frozen cell wouldn't stay at J4. So, is there better code to use, than that
provided by Excel's default macro recorder?

Thanks,

Dave
--
Brevity is the soul of wit.


"pgchop" wrote:

Application.ScreenUpdating = False
is what you are looking for ?

"Dave F" wrote:


--
Brevity is the soul of wit.

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,574
Default how do I freeze the window with VBA?

These rows/columns need to be hidden because this workbook is being sent to a
novice user of Excel who is apparently confused by extraneous data. Hiding
the sheet is irrelevant here. Only a portion of it needs to be hidden.

Dave
--
Brevity is the soul of wit.


"pgchop" wrote:

ok.
maybe the first question sould be why do you want to hide these columns.
Because you can easily make your calculations on an other sheet and hide the
entire sheet, even with a passord and even "veryhide" the sheet so that the
sheet can not be "unhidden" manually but only using vba...

Sub VeryHideSheet()
Sheets("secret").Visible = xlSheetVeryHidden
End Sub

Sub ShowSheet()
Sheets("secret").Visible = xlSheetVisible
End Sub



"Dave F" wrote:

Sorry, let me be a little more specific. I recorded a macro, which I
intended to do the following three things:

1) Hide rows 86:120
2) Hide columns AM:CP
3) Freeze the windo at cell J4

This resulted in the following code:

Sub ShowTCAPSfcst()
'
' ShowTCAPSfcst Macro
' Macro recorded 11/17/2006 by df78700
'

' Hides rows 85:120, hides columns AM:CP, and freezes window at J4
Rows("85:120").Select
Selection.EntireRow.Hidden = True
Columns("AM:CP").Select
Selection.EntireColumn.Hidden = True
Range("J4").Select
ActiveWindow.FreezePanes = True
End Sub

I attached this code to a button and started to test it. I noticed that the
frozen cell wouldn't stay at J4. So, is there better code to use, than that
provided by Excel's default macro recorder?

Thanks,

Dave
--
Brevity is the soul of wit.


"pgchop" wrote:

Application.ScreenUpdating = False
is what you are looking for ?

"Dave F" wrote:


--
Brevity is the soul of wit.



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default how do I freeze the window with VBA?

One issue you might be running up against is that freeze panes must be
removed before they can be reapplied at a new location... Try this...

Sub ShowTCAPSfcst()
'
' ShowTCAPSfcst Macro
' Macro recorded 11/17/2006 by df78700
'

' Hides rows 85:120, hides columns AM:CP, and freezes window at J4
Rows("85:120.EntireRow.Hidden = True
Columns("AM:CP").EntireColumn.Hidden = True
Range("J4").Select
ActiveWindow.FreezePanes = False
ActiveWindow.FreezePanes = True
End Sub

--
HTH...

Jim Thomlinson


"Dave F" wrote:


--
Brevity is the soul of wit.

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,574
Default how do I freeze the window with VBA?

Great, thanks.
--
Brevity is the soul of wit.


"Jim Thomlinson" wrote:

One issue you might be running up against is that freeze panes must be
removed before they can be reapplied at a new location... Try this...

Sub ShowTCAPSfcst()
'
' ShowTCAPSfcst Macro
' Macro recorded 11/17/2006 by df78700
'

' Hides rows 85:120, hides columns AM:CP, and freezes window at J4
Rows("85:120.EntireRow.Hidden = True
Columns("AM:CP").EntireColumn.Hidden = True
Range("J4").Select
ActiveWindow.FreezePanes = False
ActiveWindow.FreezePanes = True
End Sub

--
HTH...

Jim Thomlinson


"Dave F" wrote:


--
Brevity is the soul of wit.

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
Window Tool Bar - Freeze pane does not appear dford Excel Discussion (Misc queries) 2 July 20th 07 04:46 AM
How to make API call to freeze excel window? Mikeyhend[_6_] Excel Programming 7 July 25th 06 02:22 PM
Excel: find Window in which I can freeze panes 4most New Users to Excel 3 July 8th 06 10:55 PM
Excel should allow me to freeze pane in a split window MGB Excel Worksheet Functions 1 March 29th 05 05:50 PM
Advanced Window Split & Freeze Question Andrew Excel Worksheet Functions 1 November 8th 04 01:50 AM


All times are GMT +1. The time now is 07:53 PM.

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"