Some interesting hyperlinking code for you all

  • Hi All,

    I struggled a bit to create a hyperlink for
    a range of numeric data, to go to a
    link and use the number as a parameter.

    I was able to do it, may be this will be
    useful to some people. :guitar:

    Lets say, we are creating an excel sheet with the note numbers on this site, select
    them and create a hyperlink to the respective notes on this website.

    Sub Links()
    'Hyperlink Macro
    'Creates a Hyperlink to the topic

    For Each cell In Selection
    a = ActiveCell.Text
    If IsNumeric(a) Then
    ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:= _
    "" + CStr(a)
    End If
    End Sub

    This code will do the job.
    You can now go to toolbar -> customize
    and create a macro button to attach to
    this macro.

    If you need to use this in multiple sheets,
    paste the code in PERSONAL.XLS

    Please let me know if this is helpful to
    somebody in their own work, and
    if there is any better way to do it.

    Cheers : Yogendra :cheers:

    Thanks: ~Yogendra

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!