title: VBA retrieve hyperlink target sheet?
body: <p>I'm trying to retrieve the sheet reference location from a hyperlink that's in a cell</p>
  
  <p>The following doesn't seem to work as <code>test</code> doesn't return anything, even though <code>G8</code> points to Sheet: <strong>KO</strong> in Cell <code>A19</code></p>
  
  <pre><code>test = Range("G8").Hyperlinks(3).Address
  </code></pre>
  
  <p>Now if I run the following:</p>
  
  <pre><code>For Each hl In Sheets("LIST").Hyperlinks
      MsgBox "Range " &amp; hl.Range.Address &amp; " addr " &amp; _
              hl.Address &amp; " text " &amp; hl.TextToDisplay
  Next hl
  </code></pre>
  
  <p>It cycles through and finds the correct address but I can't seem to work out how to detect the sheet it's pointing. Also the loop is a bit of a mess because it errors out once it has found the first and only hyperlink in this situation. And it's not always specific for G8. I guess I could just throw an if statement in and exit the for loop early.</p>
  
  <p>Regardless of that, I can't find anywhere in stackoverflow, google, microsofts "hyperlinks" docs a way to get the sheet name.</p>
  
  <p><strong>See below sample illustration:</strong>
  <img src="https://i.imgur.com/WYh3xRn.png" alt="sample pic"></p>