Dear members, I have 5 sheets in my workbook (Sheet1, Sheet2,... Sheet5). I want create a button to move next-previous on selected sheets. Example, I want to move from Sheet2 to Sheet5 and back again from Sheet5 to Sheet2. Here my code:
Button in Sheet2:
Button in Sheet5:
I know that code work perfectly but I want to reduce the code with one macro only. I tried make new code but doesn't work properly. This code can move from Sheet2 to Sheet5 but not the other way.
Can anyone solve this problem? Thanks for answering (my stupid question) 
Button in Sheet2:
Code:
Sub MoveOn ()[INDENT]Worksheets("Sheet5").Activate[/INDENT]
[INDENT]ActiveSheet.Range("A1").Select[/INDENT]
End Sub
Code:
Sub MoveBack ()[INDENT]Worksheets("Sheet2").Activate[/INDENT]
[INDENT]ActiveSheet.Range("A1").Select[/INDENT]
End Sub
I know that code work perfectly but I want to reduce the code with one macro only. I tried make new code but doesn't work properly. This code can move from Sheet2 to Sheet5 but not the other way.
Code:
Sub MoveOn_Back ()[INDENT]If Worksheets("Sheet2").Visible = True Then[/INDENT]
[INDENT=2]Worksheets("Sheet5").Activate[/INDENT]
[INDENT=2]ActiveSheet.Range("A1").Select[/INDENT]
[INDENT]Else[INDENT]Worksheets("Sheet2").Activate[/INDENT]
[INDENT]ActiveSheet.Range("A1").Select[/INDENT]
End If
[/INDENT]
End Sub
