open to a certain sheet tab in a different workbook

A

akay71

Hello All,
I am try to do some coding to open to a certain tab in a different workbook.
I am creating the sheet tab name that I need to open with concatenate (the
name has three parts to it based on what the user select). The cell has a
name (sheettab1but the value in the cell will change). Is it possible to use
the value in sheettab1 to open to a certain tab in a different workbook?
Thanks
 
G

Gary''s Student

This assumes that the "other" workbook (a.xls) has already been opened.

We get the tab name from the Named Cell, activate a.xls and activate the
proper tab:

Sub Macro1()
s = Range("sheettab1but").Value
Windows("a.xls").Activate
Sheets(s).Activate
End Sub
 

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