Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default Goto next visible worksheet

What macro command would I include tied to a button to go to the next
visible worksheet?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 39
Default Goto next visible worksheet

Before or after the current one?

The keyboard commands use Ctrl+Page Up and Ctrl+Page Down. Record these,
using the macro recorder, and you've got your code.

--
Andy Wiggins FCCA
www.BygSoftware.com
Excel, Access and VBA Consultancy
-

"Kent McPherson" wrote in message
...
What macro command would I include tied to a button to go to the next
visible worksheet?



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 45
Default Goto next visible worksheet

Assuming the button is on the ActiveSheet:

Private Sub CommandButton1_Click()

Dim i As Integer
Dim intStart As Integer

intStart = ActiveSheet.Index + 1

For i = intStart To Worksheets.Count
If Not Worksheets(i).Visible = xlHidden Then
'Note: Could add "and Worksheets(i).Visible = xlVeryHidden to above
Worksheets(i).Activate
Exit Sub
End If
Next i

End Sub

"Kent McPherson" wrote:

What macro command would I include tied to a button to go to the next
visible worksheet?

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
Locate/goto a specific worksheet quickly johanc Excel Worksheet Functions 4 July 7th 06 04:18 PM
Worksheet has to set to visible as it is not visible after saving and closing Excel by VB. Oscar Excel Programming 6 June 21st 05 10:39 PM
GoTo the cells in another worksheet that are linked ramudo Excel Worksheet Functions 1 November 24th 04 11:46 PM
GoTo Worksheet based on which button clicked Paul Martin Excel Programming 2 July 6th 04 06:22 AM
Goto Next VISIBLE cell below Rasmus[_2_] Excel Programming 5 May 24th 04 04:26 AM


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