passinthru
Board Regular
- Joined
- Jun 16, 2003
- Messages
- 185
This is weird. I have a macro which I recorded, then modified. The first thing it does is to freeze the top row, then it goes looking for a particular row and inserts some formulae. Nothing complicated at all.
It WAS working perfectly, but I wanted some improvements in the insertion of the formulae. I got that working just fine, but now the panes freeze in the wrong place. No matter what I do, it freezes at cell I16. I want only the top row frozen.
I searched the forum here, and found this code which was reported to work:
Nope. It still freezes at I16. I have tried shutting down Excel, and even my computer, in case it is some weird bug where something is stuck in memory. No help.
I tried recording another macro to format some cells and also freeze the top row. Same result. Here's that code, en toto:
Same result. I tried copying the contents of the worksheet to Notepad, then into a fresh workbook, just in case there's some weird hangup in formatting that I can't see. No help.
I'm baffled. Any ideas? There is NOTHING in the original code that references that cell, or even that row or column. NOTHING. How it got hung up on that one cell I cannot fathom.
The Freeze Panes command works normally if I apply it manually. Any cell, anywhere, it works as expected.
It WAS working perfectly, but I wanted some improvements in the insertion of the formulae. I got that working just fine, but now the panes freeze in the wrong place. No matter what I do, it freezes at cell I16. I want only the top row frozen.
I searched the forum here, and found this code which was reported to work:
PHP:
ActiveWindow.FreezePanes = False
Range("A1").Select
ActiveWindow.FreezePanes = True
I tried recording another macro to format some cells and also freeze the top row. Same result. Here's that code, en toto:
PHP:
Sub wraptext_top_row()
'
' wraptext_top_row Macro
'
'
Rows("1:1").Select
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = True
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
Range("A1").Select
ActiveWindow.FreezePanes = True
End Sub
I'm baffled. Any ideas? There is NOTHING in the original code that references that cell, or even that row or column. NOTHING. How it got hung up on that one cell I cannot fathom.
The Freeze Panes command works normally if I apply it manually. Any cell, anywhere, it works as expected.