I'm struggling a bit with this event.
What I want to do is run some code on a specific column ("NAEMAL") that contains a textual e-mail address whenever the connection is refreshed and the data is updated.(Hopefully this is the Worksheet.TableUpdate Event???)
The table "tblVendors" is populated by one of Excel 2016's new queries, and every time the query runs, it returns a text value. :(
The idea here is to convert that textual e-mail address to a hyperlink ... automatically.
MSDN: https://msdn.microsoft.com/en-us/library/office/jj229788.aspx talks about this event, but does not provide an example.
Here is the (tested and working) code that I want to run when the data is refreshed:
Dim lstObj As ListObject
Dim rColumn As Range
Dim i As Integer
Dim txtValue As String
' Get the table reference
Set lstObj = Worksheets("VendorQuery").ListObjects("tblVendors")
' Get the column reference
Set rColumn = lstObj.ListColumns("NAEMAL").DataBodyRange
For i = 1 To .Rows.Count
txtValue = .Rows(i).Value
If InStr(1, txtValue, "@") > 1 Then
.Hyperlinks.Add Anchor:=rColumn.Rows(i), _
Address:="mailto:" & txtValue, _