View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Finny[_3_] Finny[_3_] is offline
external usenet poster
 
Posts: 49
Default Determine Cells(5,4) IN SPITE of hidden rows/columns

On Feb 21, 9:34 am, "Finny" wrote:
What I'm trying to do in whole is hide certain rows/cols and reset
freeze pane position in two setups and toggle between the two.
I'm getting a 424 on the 3rd line where I set turn off FreezePanes.
I don't understand, I thought with the activate, the object is
qualified. Also, I'm not sure if the way I'm selecting will freeze
panes properly.

Private Sub Order_Click()

Application.ScreenUpdating = False

Workbooks("Purchase Orders
Calendar.xls").Worksheets("Sheet1").Activate
ActiveWindows.FreezePanes = False

With Workbooks("Purchase Orders
Calendar.xls").Worksheets("Sheet1")
If .Columns("AD:AF").Hidden Then
.Columns("AD:AF").Hidden = False
.Rows("1:23").Hidden = False
''''Make selection (ROW) to freeze panes
.VisibleRange(2, 2).Select
.Selection.Row.Select
Else
.Columns("AD:AF").Hidden = True
.Rows("1:23").Hidden = True
''''Make selection (CELL) to freeze panes
.VisibleRange(2, 25).Select
End If
End With

ActiveWindows.FreezePanes = True
Application.ScreenUpdating = True

End Sub

I thought this would be relatively simple, I guess it depends on
experience.


btw, thanks for the reply Tom.