<o
>I have found these two codes for moving tothe next/previous visible sheets. <o
></o
>
<o
></o
>
<o
> </o
>
I have a workbook with 50 works sheets(some sheets are hidden). I created two command buttons on each sheet(“<back” “Next="" and="">”) and connected them with relevant codes. It allworks well. <o
></o
></back”>
<o
> </o
>
The only issue I have is that when moving fromone sheet (say Sheet2) to the next sheet (say Sheet3) I end up in the lastactive cell in the destination sheet. For example, if the last active cell inSheet3 was “A23” I will end up in that cell when pressing “Next>” button inSheet2 or “<back” <o
="" Sheet4.="" in="" button=""></back”></o
>
<o
> </o
>
Can anyone assist me to modify these codesso that when moves are made (either to the next or previous unhidden sheet) Ialways end up in a same destination in each worksheet sheet (say cell “A1”). <o
></o
>
<o
> </o
>
Many thanks in advance<o
></o
>
<o
> </o
>



<o


Code:
[FONT=Calibri]<o:p></o:p>[/FONT]
[FONT=Calibri][FONT=Calibri]SubNextSheet()<o:p></o:p>[/FONT][/FONT]
[FONT=Calibri][FONT=Calibri] Set Sh = ActiveSheet<o:p></o:p>[/FONT][/FONT]
[FONT=Calibri][FONT=Calibri] On Error Resume Next<o:p></o:p>[/FONT][/FONT]
[FONT=Calibri][FONT=Calibri] Do While Sh.Next.Visible <>xlSheetVisible<o:p></o:p>[/FONT][/FONT]
[FONT=Calibri][FONT=Calibri] If Err <> 0 Then Exit Do<o:p></o:p>[/FONT][/FONT]
[FONT=Calibri][FONT=Calibri] Set Sh = Sh.Next<o:p></o:p>[/FONT][/FONT]
[FONT=Calibri][FONT=Calibri] Loop<o:p></o:p>[/FONT][/FONT]
[FONT=Calibri][FONT=Calibri] Sh.Next.Activate<o:p></o:p>[/FONT][/FONT]
[FONT=Calibri][FONT=Calibri] On Error GoTo 0<o:p></o:p>[/FONT][/FONT]
[FONT=Calibri][FONT=Calibri]EndSub<o:p></o:p>[/FONT][/FONT]
[FONT=Calibri]<o:p></o:p>[/FONT]
[FONT=Calibri][FONT=Calibri]SubPrevSheet()<o:p></o:p>[/FONT][/FONT]
[FONT=Calibri][FONT=Calibri] Set Sh = ActiveSheet<o:p></o:p>[/FONT][/FONT]
[FONT=Calibri][FONT=Calibri] On Error Resume Next<o:p></o:p>[/FONT][/FONT]
[FONT=Calibri][FONT=Calibri] Do While Sh.Previous.Visible <>xlSheetVisible<o:p></o:p>[/FONT][/FONT]
[FONT=Calibri][FONT=Calibri] If Err <> 0 Then Exit Do<o:p></o:p>[/FONT][/FONT]
[FONT=Calibri][FONT=Calibri] Set Sh = Sh.Previous<o:p></o:p>[/FONT][/FONT]
[FONT=Calibri][FONT=Calibri] Loop<o:p></o:p>[/FONT][/FONT]
[FONT=Calibri][FONT=Calibri] Sh.Previous.Activate<o:p></o:p>[/FONT][/FONT]
[FONT=Calibri][FONT=Calibri] On Error GoTo 0<o:p></o:p>[/FONT][/FONT]
[FONT=Calibri][FONT=Calibri]EndSub<o:p></o:p>[/FONT][/FONT]


I have a workbook with 50 works sheets(some sheets are hidden). I created two command buttons on each sheet(“<back” “Next="" and="">”) and connected them with relevant codes. It allworks well. <o


<o


The only issue I have is that when moving fromone sheet (say Sheet2) to the next sheet (say Sheet3) I end up in the lastactive cell in the destination sheet. For example, if the last active cell inSheet3 was “A23” I will end up in that cell when pressing “Next>” button inSheet2 or “<back” <o


<o


Can anyone assist me to modify these codesso that when moves are made (either to the next or previous unhidden sheet) Ialways end up in a same destination in each worksheet sheet (say cell “A1”). <o


<o


Many thanks in advance<o


<o

