Finding worksheets by using variable names

  • Thread starter Thread starter Paul
  • Start date Start date
P

Paul

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
 
Hi Paul

With a sheet named Tom this worked fine here:

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
 

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

Similar Threads


Back
Top