Home |
Search |
Today's Posts |
#4
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Good stuff. But it only seems to work for a single cell. What can be done
if we want to run a SQL query against a database and wrap one of the columns of the query with an HREF tag? Embedding the HYPERLINK macro into the SELECT results seems to do the trick: select '=HYPERLINK("http://www.microsoft.com", "Microsoft")' FROM <tables, joins, where, etc. seems to do the trick. Of course you'll be interested in a result from the query and replace the "Microsoft" with your actual result from the query. "JLatham" wrote: This version will work better for you. I had the formula going into the cell in the next column for testing, this corrects it and overwrites the <a href= entry with the HYPERLINK() formula. Private Sub Worksheet_Change(ByVal Target As Range) Dim hLink As String Dim hLocation As String Dim tagPosition As Integer If Target.Cells.Count 1 Then Exit Sub ' only work when just 1 cell changed End If If UCase(Left(Target, 8)) = "<A HREF=" Then hLink = Mid(Target, 9, InStrRev(Target, """") - 8) MsgBox "hLink = '" & hLink & "'" tagPosition = InStr(Target, "") hLocation = Chr$(34) & Mid(Target, tagPosition + 1, _ Len(Target) - 4 - tagPosition) & Chr$(34) Target.Formula = "=HYPERLINK(" & _ hLink & "," & hLocation & ")" End If End Sub " wrote: Is it possible when importing from another data source say SQL Server stored in table as a href and have excel evaluate the text as hyperlink. i.e Import data <a href="http://www.microsoft.com"Microsoft</a into cell A1. Excel 2007 sees the data as text until you click into the cell then off of it then it converts the cell to read only Microsoft as a hyperlink. I want to avoid using macro's but hoping there is an addon or a setting to force XLS to automatically refresh/reevaluate. TIA |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Pasted HTML Table Data Won't Convert From Text | Excel Discussion (Misc queries) | |||
can I hyperlink to a worksheet tab in workbook saved as html? | Excel Discussion (Misc queries) | |||
hyperlink to sheet in workbook saved as html | Excel Discussion (Misc queries) | |||
How to convert a hyperlink to its target full-text URL | Excel Discussion (Misc queries) | |||
hyperlink cell value inserted | Excel Worksheet Functions |