Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Problems specifying where "freezepanes" occurs using VBA

Try using

ActiveWindow.ScrollRow = 1

before your existing code. It's the only way I've gotten it to work
correctly.

Scott Hannon
AL, USA
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Problems specifying where "freezepanes" occurs using VBA


Hi Scott,

Thanks for the feedback - I tried it at work today & it works
wonderfully :-)
It's great to come back from holiday & have a solution waiting for me.

thanks,
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

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
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell Steve Kay Excel Discussion (Misc queries) 2 August 8th 08 01:54 AM
change "true" and "false" to "availble" and "out of stock" inthestands Excel Worksheet Functions 2 July 19th 07 07:05 PM
HELP on "left","right","find","len","substitute" functions serene83 Excel Discussion (Misc queries) 5 June 27th 06 02:23 AM
Count occurences of "1"/"0" (or"TRUE"/"FALSE") in a row w. conditions in the next BCB New Users to Excel 7 May 13th 06 10:02 PM
VB for "conditional" formatting when recalc occurs Kenny Excel Programming 1 September 13th 05 03:52 AM


All times are GMT +1. The time now is 09:05 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"