View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
broro183[_66_] broro183[_66_] is offline
external usenet poster
 
Posts: 1
Default Problems specifying where "freezepanes" occurs using VBA


Hi all,

I'm having problems specifying where "freezepanes" occurs using VBA.
It doesn't take much to press [ctrl + home], [alt + w +f] (my work
around) before running a formatting macro. However, I'm curious, is
there anything in Excel's (XP, Excel 2002/2003) set up which may
prevent either of the below from working?

Range("A2").Select
ActiveWindow.FreezePanes = True

or:
Application.Goto reference:=Range("a2"), scroll:=True
ActiveWindow.FreezePanes = True

This was recorded using the macro recorder but when I run the code the
second line has sometimes worked & sometimes resulted in the freeze
panes being applied in, for example, cell "D17" approximately the
centre of the centre of my screen (not previously selected). This has
puzzled me to the extent that I have commented out the code, & now
select cell A2 and manually freeze the pane.

This is part of the formatting of a single sheet .csv file which is
received on a daily basis & saved as an xls file. Could it be possible
that turning off the screen updating before running this code is
causing the problem?

thanks in advance
Rob Brockett
NZ
Always learning & the best way to learn is to experience...


--
broro183
------------------------------------------------------------------------
broro183's Profile: http://www.excelforum.com/member.php...o&userid=30068
View this thread: http://www.excelforum.com/showthread...hreadid=529934