Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Automatic top of sheet?


I am using buttons for navigating between sheets but I also want th
destination sheet to be automatically scrolled to top of page when i
is displayed. The code i am using is simply:

Private Sub CommandButton2_Click()
On Error Resume Next
ActiveSheet.Previous.Select
If Err Then ActiveSheet.Next.Select
End Sub

I tried to add a selection of cell A1:

Private Sub CommandButton2_Click()
On Error Resume Next
ActiveSheet.Previous.Select
*Range("A1").Select*
If Err Then ActiveSheet.Next.Select
End Sub

...but of course the destination sheet was shown briefly and then cel
A1 in the current sheet was selected. Is there any work around this?

Grateful for any help!
/Bow

--
bow
-----------------------------------------------------------------------
bowe's Profile: http://www.excelforum.com/member.php...fo&userid=2711
View this thread: http://www.excelforum.com/showthread.php?threadid=46624

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,624
Default Automatic top of sheet?

One way:

Private Sub CommandButton2_Click()
With ActiveSheet
If .Index = 1 Then
.Next.Select
Else
.Previous.Select
End If
End With
ActiveSheet.Range("A1").Select
End Sub


In article ,
bowe wrote:

I am using buttons for navigating between sheets but I also want the
destination sheet to be automatically scrolled to top of page when it
is displayed. The code i am using is simply:

Private Sub CommandButton2_Click()
On Error Resume Next
ActiveSheet.Previous.Select
If Err Then ActiveSheet.Next.Select
End Sub

I tried to add a selection of cell A1:

Private Sub CommandButton2_Click()
On Error Resume Next
ActiveSheet.Previous.Select
*Range("A1").Select*
If Err Then ActiveSheet.Next.Select
End Sub

..but of course the destination sheet was shown briefly and then cell
A1 in the current sheet was selected. Is there any work around this?

Grateful for any help!
/Bowe

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Automatic top of sheet?


Great! Thanks McGimpsey! Your answer stopped me from going bold :

--
bow
-----------------------------------------------------------------------
bowe's Profile: http://www.excelforum.com/member.php...fo&userid=2711
View this thread: http://www.excelforum.com/showthread.php?threadid=46624

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
automatic sheet selection swiftcode Excel Discussion (Misc queries) 2 June 4th 10 09:02 AM
Sheet selected, automatic return to top of sheet MIKEY Excel Worksheet Functions 7 March 9th 10 10:58 AM
Automatic updating of 2nd sheet from first fibregrid Excel Worksheet Functions 3 July 29th 05 02:37 PM
Automatic cell increment with data from sheet 1 to sheet 2 Big G Excel Worksheet Functions 2 December 20th 04 05:59 PM
automatic copy and paste from sheet to sheet in a workbook ramseyjramseyj Excel Programming 6 December 11th 04 12:37 AM


All times are GMT +1. The time now is 03:38 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"