Solved

EXCEL: HYPERLINK WITH DYNAMIC XLS FILE

Posted on 2014-11-28
8
395 Views
Last Modified: 2014-12-26
Hello,
I have a Excel file with odbc connexion.
for the sample I need the following:

col A - data
col B - URL
col C - data

is there a way to make automatically col B hyperlink link ?
I know how to do it with normal xls spreed but not with dynamic ...
0
Comment
Question by:bruno_boccara
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
8 Comments
 
LVL 18

Expert Comment

by:Simon
ID: 40470217
Would it be acceptable to put a formula column to the right of the results columns?
=HYPERLINK(B1)
or make the dynamic columns hidden and create 3 columns to the right so you have
=A1
=HYPERLINK(B1)
=C1
0
 
LVL 21

Expert Comment

by:Tapan Pattanaik
ID: 40470219
Hi bruno_boccara,

If you don't want to create a macro and as long as you don't mind an additional column, then just create a new column alongside your column of URLs. (here, col B)

In the new column type in the formula =HYPERLINK(B). Then copy the formula down the rest of the  entries.
0
 

Author Comment

by:bruno_boccara
ID: 40470247
I do not want to add manually formula.

If I have to create a macro , it is also ok with me. what will be the macro ?
0
Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

 
LVL 21

Expert Comment

by:Tapan Pattanaik
ID: 40470285
Public Sub Convert_To_Hyperlinks()
    Dim Cell As Range
    For Each Cell In Intersect(Selection, ActiveSheet.UsedRange)
        If Cell <> "" Then
            ActiveSheet.Hyperlinks.Add Cell, Cell.Value
        End If
    Next
End Sub
0
 
LVL 5

Accepted Solution

by:
Hakan Yılmaz earned 500 total points
ID: 40472199
You may try this.

Sub MakeRangeHyper(ByRef LinkRange As Range)
      Dim iterCell As Range
      For Each iterCell In Intersect(LinkRange, LinkRange.Worksheet.UsedRange)
            LinkRange.Worksheet.Hyperlinks.Add iterCell, iterCell.Value2
      Next iterCell
End Sub

Open in new window


You should call this sub with a reference to cells that have link addresses. Example:

Sub StartHyper()
    MakeRangeHyper ActiveWorkbook.ActiveSheet.UsedRange
    MakeRangeHyper ActiveWorkbook.ActiveSheet.Range("B4:B5")
    MakeRangeHyper ThisWorkbook.Worksheets("Sheet1").Range("B4:B5")
End Sub

Open in new window

0
 

Author Comment

by:bruno_boccara
ID: 40512706
Please let the question open.
did not have time to check the solution.
But it is very important for me.

Regards.
0
 
LVL 47

Expert Comment

by:Martin Liss
ID: 40518270
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
0

Featured Post

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
With User Account Control (UAC) enabled in Windows 7, one needs to open an elevated Command Prompt in order to run scripts under administrative privileges. Although the elevated Command Prompt accomplishes the task, the question How to run as script…
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

696 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question