Select and Run

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a workbook with instructions, I would like to make it so that if you
press on a cell that has the topic you're looking for, then you'll be
directed to the text for that topic. How can I do that?

For example:
A1 How to bake - if I click on this cell, then I'd be directed to Sheet2!B1


Thanks.
 
I would use a double-click rather than a single click. Right-click the sheet
tab for Sheet1, for example, choose View Code, and paste in the following
code:

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As
Boolean)
Select Case Target.Address(False, False)
Case "A1"
Cancel = True
Application.Goto reference:=Worksheets("Sheet2").Range("B1")
Case "A3"
Cancel = True
Application.Goto reference:=Worksheets("Sheet2").Range("B3")
' other Case statements for other cells
End Select
End Sub

If the user double-clicks on A1 or A3, they'll be taken to a range on
Sheet2. Add additioanl Case elements for the various cells.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel, 10 Years
Pearson Software Consulting
www.cpearson.com
(email on the web site)
 

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

Back
Top