Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 14
Default How can I use a cell value to select a sheet tab?

I want to be able to use values in column A (which match the names of the
worksheet tabs in my workbook), to select which sheet I look up (using
VLOOKUP) values in column B from (which contain values contained in one of
those sheets).

I remember I did this once before using INDIRECT or something similar but I
can't remember exactly how - can anyone help?

Cheers
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10,124
Default How can I use a cell value to select a sheet tab?

Right click sheet tabview codecopy/paste this.
Now, if you have the name of the sheet tab typed into a cell and double
click on that cell you are taken to the tab.

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As
Boolean)
Application.DisplayAlerts = False
Dim WantedSheet As String
WantedSheet = Trim(ActiveCell.Value)
If WantedSheet = "" Then Exit Sub
On Error Resume Next
If Sheets(WantedSheet) Is Nothing Then
' GetWorkbook ' calls another macro to do that
Else
Application.GoTo Sheets(WantedSheet).Range("a1")
End If
Application.DisplayAlerts = True
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Monkey-See, Monkey-Do" wrote
in message ...
I want to be able to use values in column A (which match the names of the
worksheet tabs in my workbook), to select which sheet I look up (using
VLOOKUP) values in column B from (which contain values contained in one of
those sheets).

I remember I did this once before using INDIRECT or something similar but
I
can't remember exactly how - can anyone help?

Cheers


  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,501
Default How can I use a cell value to select a sheet tab?

Hi,

Is this what you mean

=VLOOKUP(B1,INDIRECT(A1&"!A1:B30"),2,FALSE)

Where a1 contaibs a sheet name.

Mike

"Monkey-See, Monkey-Do" wrote:

I want to be able to use values in column A (which match the names of the
worksheet tabs in my workbook), to select which sheet I look up (using
VLOOKUP) values in column B from (which contain values contained in one of
those sheets).

I remember I did this once before using INDIRECT or something similar but I
can't remember exactly how - can anyone help?

Cheers

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,856
Default How can I use a cell value to select a sheet tab?

You VLOOKUP formula will probably have something like this as the
second parameter:

INDIRECT("'"&A1&"'!A:B")

where A1 contains the sheet name and I've assumed you have a two
column table in columns A and B of the sheet where you are trying to
get data from.

Hope this helps.

Pete

On Oct 13, 1:34*pm, Monkey-See, Monkey-Do
wrote:
I want to be able to use values in column A (which match the names of the
worksheet tabs in my workbook), to select which sheet I look up (using
VLOOKUP) values in column B from (which contain values contained in one of
those sheets).

I remember I did this once before using INDIRECT or something similar but I
can't remember exactly how - can anyone help?

Cheers




  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 14
Default How can I use a cell value to select a sheet tab?

Thanks Pete,

Spot on!

Cheers from the UK

"Pete_UK" wrote:

You VLOOKUP formula will probably have something like this as the
second parameter:

INDIRECT("'"&A1&"'!A:B")

where A1 contains the sheet name and I've assumed you have a two
column table in columns A and B of the sheet where you are trying to
get data from.

Hope this helps.

Pete

On Oct 13, 1:34 pm, Monkey-See, Monkey-Do
wrote:
I want to be able to use values in column A (which match the names of the
worksheet tabs in my workbook), to select which sheet I look up (using
VLOOKUP) values in column B from (which contain values contained in one of
those sheets).

I remember I did this once before using INDIRECT or something similar but I
can't remember exactly how - can anyone help?

Cheers



  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,856
Default How can I use a cell value to select a sheet tab?

You're welcome - thanks for feeding back.

Pete

On Oct 13, 2:29*pm, Monkey-See, Monkey-Do
wrote:
Thanks Pete,

Spot on!

Cheers from the UK

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
Linking sheet - Formula Match Exact or select next row and cell Lil Knight Excel Discussion (Misc queries) 0 May 15th 08 09:13 PM
hyperlink - clicking on hyper link to select cell in another sheet Aaron Hodson \(Coversure\) Excel Worksheet Functions 3 January 3rd 08 02:58 PM
Select sheet from cell value Grid Excel Discussion (Misc queries) 9 July 16th 07 01:02 PM
View, scroll and select a cell value from another Excel sheet? benb Excel Worksheet Functions 1 October 12th 06 05:48 AM
How do I select price from sheet.b where sheet.a part no = sheet.b Sonny Excel Worksheet Functions 4 April 4th 06 05:08 PM


All times are GMT +1. The time now is 08:21 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"