Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 60
Default Programmatically scrolling to top

Hello,
I have an Excel VBA app and I need automatically scroll to the top left
(cell A1) when each worksheet is selected and activated. I tried using the
Select, Activate and Show methods for the range in the Worksheet_Activate sub
but they didn't work.
Any ideas on a simple technique to do so?
Thanks, God bless
Van
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,163
Default Programmatically scrolling to top

Where did you put the code, and how did you write it? Sounds like the idea
should work; you would need to put the code in each worksheet's module,
though, to get it to work for every sheet. This code should work:

Private Sub Worksheet_Activate()

Range("A1").Select

End Sub


"VanS" wrote:

Hello,
I have an Excel VBA app and I need automatically scroll to the top left
(cell A1) when each worksheet is selected and activated. I tried using the
Select, Activate and Show methods for the range in the Worksheet_Activate sub
but they didn't work.
Any ideas on a simple technique to do so?
Thanks, God bless
Van

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default Programmatically scrolling to top


The following codes worked with me.
I think it should work with you too, if you do not have any sepcial stuff in
your sheets.

Private Sub Worksheet_Activate()
Range("A1").Select
End Sub

===== * ===== * ===== * =====
Daniel CHEN


www.Geocities.com/UDQServices
Free Data Processing Add-in<

===== * ===== * ===== * =====

"VanS" wrote in message
...
Hello,
I have an Excel VBA app and I need automatically scroll to the top left
(cell A1) when each worksheet is selected and activated. I tried using the
Select, Activate and Show methods for the range in the Worksheet_Activate
sub
but they didn't work.
Any ideas on a simple technique to do so?
Thanks, God bless
Van



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 691
Default Programmatically scrolling to top

see
http://www.mvps.org/dmcritchie/excel...oc.htm#TopLeft

specifically:
Application.Goto Reference:=Cells(1, 1), Scroll:=True
---
HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

"VanS" wrote in message ...
Hello,
I have an Excel VBA app and I need automatically scroll to the top left
(cell A1) when each worksheet is selected and activated. I tried using the
Select, Activate and Show methods for the range in the Worksheet_Activate sub
but they didn't work.
Any ideas on a simple technique to do so?
Thanks, God bless
Van



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,327
Default Programmatically scrolling to top

Hi Van

The provided solutions will make A1 the selected cell. You may or may not
want that. If not, put this in the ThisWorkbook module:

Private Sub Workbook_SheetActivate(ByVal Sh As Object)
ActiveWindow.ScrollColumn = 1
ActiveWindow.ScrollRow = 1
End Sub

HTH. Best wishes Harald


"VanS" skrev i melding
...
Hello,
I have an Excel VBA app and I need automatically scroll to the top left
(cell A1) when each worksheet is selected and activated. I tried using the
Select, Activate and Show methods for the range in the Worksheet_Activate

sub
but they didn't work.
Any ideas on a simple technique to do so?
Thanks, God bless
Van





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 60
Default Programmatically scrolling to top

Thanks to all of you that replied.
As indicated the Select method doesn't work though it seems it should. Your
solutions David and Harald did, so appreciate you help.
God bless
Van

"Harald Staff" wrote:

Hi Van

The provided solutions will make A1 the selected cell. You may or may not
want that. If not, put this in the ThisWorkbook module:

Private Sub Workbook_SheetActivate(ByVal Sh As Object)
ActiveWindow.ScrollColumn = 1
ActiveWindow.ScrollRow = 1
End Sub

HTH. Best wishes Harald


"VanS" skrev i melding
...
Hello,
I have an Excel VBA app and I need automatically scroll to the top left
(cell A1) when each worksheet is selected and activated. I tried using the
Select, Activate and Show methods for the range in the Worksheet_Activate

sub
but they didn't work.
Any ideas on a simple technique to do so?
Thanks, God bless
Van




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- smooth scrolling (instead of 'snap' scrolling) scooterbaga Setting up and Configuration of Excel 2 April 24th 08 02:16 PM
Vertical scrolling...jumps rather than smooth scrolling Miller Man Excel Discussion (Misc queries) 2 January 23rd 07 07:11 PM
Live Scrolling/Real-Time /Smooth Scrolling doesn't work for me in Excel, even 2007 beta [email protected] Excel Discussion (Misc queries) 2 July 21st 06 01:21 AM
Live Scrolling/Real-Time /Smooth Scrolling doesn't work for me in Excel 2003 [email protected] Excel Discussion (Misc queries) 0 May 12th 06 03:15 AM
How do I programmatically specify a range. Hari[_3_] Excel Programming 4 January 17th 05 03:31 PM


All times are GMT +1. The time now is 03:31 PM.

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

About Us

"It's about Microsoft Excel"