Adding a back button

E

engmgriff

Hi

I have a workbook with three different sheets in. Each sheet ha
around ten buttons in which once pressed jumbs into another workbook.


I cannot program in VB does anyone have any code which would allow m
to do the following.

From the first workbook (say WK1) the 3 worksheets have buttons i
which jump to another workbook (say WK2). In WK2 I want to add
button which backs upto WK1, but depending which sheet I pressed th
button on, to go to WK2 I want to go back to that worksheet.

Mat
 
B

Bob Phillips

Ctrl-PageUp and Ctrl-PageDown already does that for you.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
R

Rick N

Try the followng:

Sub gotoSheet2()
thebook = ActiveCell.Worksheet.Parent.Name
thesheet = ActiveCell.Worksheet.Name
Sheets("Sheet2").Select
Range("A1") = thesheet
range("B1")=thebook
End Sub
Sub goBack()
theReturnBook=[B1]
theReturnSheet = [A1]
workbooks(theReturnBook).Select
Sheets(theReturnSheet).Select
End Sub

I included the variable named "thebook" which captures
the name of the workbook. This will allow you to go back
to the original workbook and worksheet. Also - the CTRL
PAGE UP and CTRL PAGE DOWN will move you back and forth
from sheet to sheet within a workbook and CTRL F6 will
move you back and forth from (open) workbook to (open)
workbook.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top