title: How do I pass the contents of the "Target" range in a "Worksheet_SelectionChange event to a sub?
body: <p>Sheet 1 of my workbook contains (besides other data) a list of the other worksheets in column A. I wish to be able to click on any cell in column A5:A50 and go to the appropriate worksheet listed in that cell. My Sheet1 code is:</p>
  
  <pre><code>Private Sub Worksheet_SelectionChange(ByVal Target As Range)
      If Not Intersect(Target, Me.Range("A5:A50")) Is Nothing Then SelectWorksheet
  End Sub
  </code></pre>
  
  <p>and Module2 is:</p>
  
  <pre><code>Sub SelectWorksheet()
      Dim strName As String
      strName = Sheet1.Range("Target").Text (Error occurrs here: "Method 'Range' of object 'Worksheet' failed")
      Sheets(strName).Select
  End Sub
  </code></pre>
  
  <p>How do I get this to work as I expect? I know I could just click on the appropriate worksheet tab but I'm trying to learn how to code in VBA. Thanks. By the way, how do I get my post to show the code as typed in the question box?</p>