|
|
Hello,
I am trying to freeze panes in vba with the following code:
Range("A3").EntireRow.Select
ActiveWindow.FreezePanes = True
this results in the sheet being frozen in the middle of the sheet, not from row 3 up?
If I do it manually by selecting the entire row 3 and go to the drop down menu and select freeze panes it seems to work properly.
any suggestions?
thanks,
Lino
This is what the macro recorded spitted out:Sub Macro1()
'
' Macro1 Macro
' Macro grabada el 27/05/2003 por Juan Pablo G.
'
'
****Rows("3:3").Select
****ActiveWindow.FreezePanes = True
End SubTry it to see if it makes any difference at all... (Oh, and it should show rows 1 and 2 all the time, not 3)
I had your code first and that didn't work either...have you tried it?
Lino
Yep, works for me. What version are you using ? that was tested on 2000.
this is exactly what i have...do you see any problems?
Cells.Select Cells.EntireColumn.AutoFit With Selection.Font.Name = "Arial".Size = 8.Strikethrough = False.Superscript = False.Subscript = False.OutlineFont = False.Shadow = False.Underline = xlUnderlineStyleNone ' .ColorIndex = xlAutomatic End With ActiveWindow.Zoom = 75 ActiveWindow.FreezePanes = False Rows("3:3").Select ActiveWindow.FreezePanes = Truelino
Ah... maybe the problem is that row 3 isn't visible in the window at the moment you turn on Freeze Panes.
Try putting this before the Rows("3:3").Select
Application.Goto Range("A1"), True
row 3 is visible...but it worked this time?
what does that code do...what is made true?
Lino
It just makes Excel put A1 as the top left cell of the window. |
|