Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 108
Default Finding worksheets by using variable names

Hi,

Sheets are named "Jim" "Tom" "Judy" etc. The MASTER sheet
also has these names in a table. I want to click on a cell
containing "Tom" and have the code jump to the Tom sheet.

I tried this:
AAA=Activecell.value ' the cell contains word "Tom"
Sheets(AAA).select 'should find Tom sheet

But I get an error message, probably because VB is
expecting the AAA to be in quotes, and it's no recognizig
that AAA is a variable value.

Help appreciated
Paul


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,327
Default Finding worksheets by using variable names

Hi Paul

With a sheet named Tom this worked fine he

Sub test()
Dim AAA As String
AAA = "Tom"
Sheets(AAA).Select
End Sub

But I get an error message, probably because VB is
expecting the AAA to be in quotes


No. What did the message actually say ?

Best wishes Harald

"Paul" skrev i melding
...
Hi,

Sheets are named "Jim" "Tom" "Judy" etc. The MASTER sheet
also has these names in a table. I want to click on a cell
containing "Tom" and have the code jump to the Tom sheet.

I tried this:
AAA=Activecell.value ' the cell contains word "Tom"
Sheets(AAA).select 'should find Tom sheet

But I get an error message, probably because VB is
expecting the AAA to be in quotes, and it's no recognizig
that AAA is a variable value.

Help appreciated
Paul




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
reference other worksheets via variable names Huggy Excel Worksheet Functions 4 June 26th 08 05:52 AM
Finding the names that are not there Learning Excel Excel Discussion (Misc queries) 5 December 16th 07 05:52 PM
Finding Latest Variable Ken Excel Discussion (Misc queries) 1 August 17th 07 06:13 AM
Finding unique names--then converting those names to unique number Proton Excel Discussion (Misc queries) 7 June 13th 07 10:22 PM
Finding Names exsam21 Excel Worksheet Functions 1 January 17th 06 09:40 PM


All times are GMT +1. The time now is 12:36 AM.

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

About Us

"It's about Microsoft Excel"