<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Reading Excel hyperlinks and stroring them in a new column (SAS 9.4) in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Reading-Excel-hyperlinks-and-stroring-them-in-a-new-column-SAS-9/m-p/567895#M159756</link>
    <description>&lt;P&gt;I have an Excel (.xlsx) file that includes a column with an embedded hyperlink to a website. I would like to be able to have sas read the hyperlink and store it as a string in a new variable. I am not sure how to accomplish this. It is not an option to just create the hyperlink text manually because the source document hyperlinks are different in each cell and the part that changes is not available in any other location at this time. Please see the attached test document.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Summary: I would like to take the hyperlink in the "patient name" var and put it into a new var called "hyperlink" as a string value.&lt;/P&gt;</description>
    <pubDate>Fri, 21 Jun 2019 12:44:53 GMT</pubDate>
    <dc:creator>Informatician</dc:creator>
    <dc:date>2019-06-21T12:44:53Z</dc:date>
    <item>
      <title>Reading Excel hyperlinks and stroring them in a new column (SAS 9.4)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-Excel-hyperlinks-and-stroring-them-in-a-new-column-SAS-9/m-p/567895#M159756</link>
      <description>&lt;P&gt;I have an Excel (.xlsx) file that includes a column with an embedded hyperlink to a website. I would like to be able to have sas read the hyperlink and store it as a string in a new variable. I am not sure how to accomplish this. It is not an option to just create the hyperlink text manually because the source document hyperlinks are different in each cell and the part that changes is not available in any other location at this time. Please see the attached test document.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Summary: I would like to take the hyperlink in the "patient name" var and put it into a new var called "hyperlink" as a string value.&lt;/P&gt;</description>
      <pubDate>Fri, 21 Jun 2019 12:44:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-Excel-hyperlinks-and-stroring-them-in-a-new-column-SAS-9/m-p/567895#M159756</guid>
      <dc:creator>Informatician</dc:creator>
      <dc:date>2019-06-21T12:44:53Z</dc:date>
    </item>
    <item>
      <title>Re: Reading Excel hyperlinks and stroring them in a new column (SAS 9.4)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-Excel-hyperlinks-and-stroring-them-in-a-new-column-SAS-9/m-p/568313#M159952</link>
      <description>Not sure if SAS can extract hyperlinks embedded in texts. However you can achieve the intended result easily by using simple Excel VBA for all cells in a column. Afterwards you can read and analyze in SAS.</description>
      <pubDate>Mon, 24 Jun 2019 07:48:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-Excel-hyperlinks-and-stroring-them-in-a-new-column-SAS-9/m-p/568313#M159952</guid>
      <dc:creator>koyelghosh</dc:creator>
      <dc:date>2019-06-24T07:48:55Z</dc:date>
    </item>
    <item>
      <title>Re: Reading Excel hyperlinks and stroring them in a new column (SAS 9.4)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-Excel-hyperlinks-and-stroring-them-in-a-new-column-SAS-9/m-p/568339#M159964</link>
      <description>&lt;P&gt;Can you post an extract of the data as dataset? See &lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-data-AKA-generate/ta-p/258712" target="_blank"&gt;https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-data-AKA-generate/ta-p/258712&lt;/A&gt; for details.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Extracting a hyperlink should be possible with a regular expression.&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jun 2019 11:03:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-Excel-hyperlinks-and-stroring-them-in-a-new-column-SAS-9/m-p/568339#M159964</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2019-06-24T11:03:49Z</dc:date>
    </item>
    <item>
      <title>Re: Reading Excel hyperlinks and stroring them in a new column (SAS 9.4)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-Excel-hyperlinks-and-stroring-them-in-a-new-column-SAS-9/m-p/568347#M159969</link>
      <description>&lt;P&gt;Unfortunately no, the data is HIPAA protected. However, I did attach a mock raw excel file to assist.&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jun 2019 13:02:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-Excel-hyperlinks-and-stroring-them-in-a-new-column-SAS-9/m-p/568347#M159969</guid>
      <dc:creator>Informatician</dc:creator>
      <dc:date>2019-06-24T13:02:13Z</dc:date>
    </item>
    <item>
      <title>Re: Reading Excel hyperlinks and stroring them in a new column (SAS 9.4)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-Excel-hyperlinks-and-stroring-them-in-a-new-column-SAS-9/m-p/568361#M159972</link>
      <description>&lt;P&gt;Most likely you are good with VBA so you might have solved it by now. Just in case (and for future help to somebody) I am giving the steps below to extract the hyperlinks.&amp;nbsp;&lt;/P&gt;&lt;P&gt;The code that you will type, as shown in the 4th image has been largely taken from here (&lt;A href="http://howtouseexcel.net/how-to-extract-a-url-from-a-hyperlink-on-excel" target="_blank"&gt;http://howtouseexcel.net/how-to-extract-a-url-from-a-hyperlink-on-excel&lt;/A&gt;). All I have done is shown you the process step by step. You can change the code to suit your need. The Code that you will type when you reach the fourth step is as below.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Sub ExtractHyperlink()
    Dim HL As Hyperlink
        For Each HL In ActiveSheet.Hyperlinks
            HL.Range.Offset(0, 1).Value = HL.Address
        Next
End Sub&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;STRONG&gt;Now I am giving 6 steps in the form of consecutive 6 images.&lt;/STRONG&gt; Please follow in sequence. &lt;STRONG&gt;Make sure you have a back up of the excel file on which you are going to work (just in case :-))&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Step-01" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/30488i0786719B98D7F952/image-size/large?v=v2&amp;amp;px=999" role="button" title="Step_01.png" alt="Step-01" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Step-01&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Step_02" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/30489i40E7C694C37D00CF/image-size/large?v=v2&amp;amp;px=999" role="button" title="Step_02.png" alt="Step_02" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Step_02&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Step_03" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/30490i7A57B75B353EFE1E/image-size/large?v=v2&amp;amp;px=999" role="button" title="Step_03.png" alt="Step_03" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Step_03&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Step_04" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/30491iE798C4B5CEC07F3F/image-size/large?v=v2&amp;amp;px=999" role="button" title="Step_04.png" alt="Step_04" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Step_04&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Step_05" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/30492i037047C97D75D0C0/image-size/large?v=v2&amp;amp;px=999" role="button" title="Step_05.png" alt="Step_05" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Step_05&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Step_06" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/30493i0CF4E82BE9A61E5B/image-size/large?v=v2&amp;amp;px=999" role="button" title="Step_06.png" alt="Step_06" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Step_06&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;At this point, you can export it as csv and read using PROC IMPORT. The extension of this file would have changed from .xls/.xlsx to .xlsm, so EXCEL import will not work. I hope you get the idea.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please let me know if this helped in any way.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jun 2019 13:33:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-Excel-hyperlinks-and-stroring-them-in-a-new-column-SAS-9/m-p/568361#M159972</guid>
      <dc:creator>koyelghosh</dc:creator>
      <dc:date>2019-06-24T13:33:05Z</dc:date>
    </item>
    <item>
      <title>Re: Reading Excel hyperlinks and stroring them in a new column (SAS 9.4)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-Excel-hyperlinks-and-stroring-them-in-a-new-column-SAS-9/m-p/568372#M159978</link>
      <description>Sorry but I can't open excel files at all.</description>
      <pubDate>Mon, 24 Jun 2019 14:24:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-Excel-hyperlinks-and-stroring-them-in-a-new-column-SAS-9/m-p/568372#M159978</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2019-06-24T14:24:47Z</dc:date>
    </item>
    <item>
      <title>Re: Reading Excel hyperlinks and stroring them in a new column (SAS 9.4)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-Excel-hyperlinks-and-stroring-them-in-a-new-column-SAS-9/m-p/568374#M159979</link>
      <description>Oh! I have more respect now for the problem you are facing. Time to ask an expert.</description>
      <pubDate>Mon, 24 Jun 2019 14:30:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-Excel-hyperlinks-and-stroring-them-in-a-new-column-SAS-9/m-p/568374#M159979</guid>
      <dc:creator>koyelghosh</dc:creator>
      <dc:date>2019-06-24T14:30:43Z</dc:date>
    </item>
    <item>
      <title>Re: Reading Excel hyperlinks and stroring them in a new column (SAS 9.4)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-Excel-hyperlinks-and-stroring-them-in-a-new-column-SAS-9/m-p/568522#M160048</link>
      <description>&lt;P&gt;I did something very similar using the code below.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Function GetURL(pWorkRng As Range) As String&lt;/P&gt;&lt;P&gt;GetURL = pWorkRng.Hyperlinks(1).Address&lt;/P&gt;&lt;P&gt;End Function&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank You Everyone!&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jun 2019 19:42:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-Excel-hyperlinks-and-stroring-them-in-a-new-column-SAS-9/m-p/568522#M160048</guid>
      <dc:creator>Informatician</dc:creator>
      <dc:date>2019-06-24T19:42:07Z</dc:date>
    </item>
  </channel>
</rss>

