+ Reply to Thread
Results 1 to 6 of 6

Hyperlink macro for personal.xls

  1. #1
    al007
    Guest

    Hyperlink macro for personal.xls

    Sub Hyperlinkcell()
    '
    Dim actual As Range

    Set actual = Application.InputBox(Prompt:="Select cell to
    hyperlink.", Type:=8)
    ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:="",
    SubAddress:=actual, TextToDisplay:=ActiveCell.Value
    End Sub

    Can anybody fix the above hyperlink macro pls.

    Thxs


  2. #2
    Norman Jones
    Guest

    Re: Hyperlink macro for personal.xls

    Hi Al007,

    Try:

    '=============>>
    Public Hyperlinkcell()
    Dim actual As Range

    Set actual = Application. _
    InputBox(Prompt:="Select cell to hyperlink.", _
    Type:=8)
    '

    ActiveSheet.Hyperlinks.Add _
    Anchor:=Selection, _
    Address:="", _
    SubAddress:=actual.Address(0, 0)
    End Sub
    '<<=============

    ---
    Regards,
    Norman


    "al007" <transferxxx@gmail.com> wrote in message
    news:1134041437.581886.78060@g44g2000cwa.googlegroups.com...
    > Sub Hyperlinkcell()
    > '
    > Dim actual As Range
    >
    > Set actual = Application.InputBox(Prompt:="Select cell to
    > hyperlink.", Type:=8)
    > ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:="",
    > SubAddress:=actual, TextToDisplay:=ActiveCell.Value
    > End Sub
    >
    > Can anybody fix the above hyperlink macro pls.
    >
    > Thxs
    >




  3. #3
    al007
    Guest

    Re: Hyperlink macro for personal.xls

    Thxs - but it does not work if a cell from a different sheet is
    selected - can you help pls


  4. #4
    Tom Ogilvy
    Guest

    Re: Hyperlink macro for personal.xls

    Sub Hyperlinkcell()
    '
    Dim actual As Range

    Set actual = Application.InputBox( _
    Prompt:="Select cell to hyperlink.", Type:=8)
    ActiveSheet.Hyperlinks.Add _
    Anchor:=Selection, _
    Address:="", _
    SubAddress:="'" & actual.Parent.Name & _
    "'!" & actual.Address(0, 0), _
    TextToDisplay:=actual.Text
    End Sub


    --
    Regards,
    Tom Ogilvy


    "al007" <transferxxx@gmail.com> wrote in message
    news:1134041437.581886.78060@g44g2000cwa.googlegroups.com...
    > Sub Hyperlinkcell()
    > '
    > Dim actual As Range
    >
    > Set actual = Application.InputBox(Prompt:="Select cell to
    > hyperlink.", Type:=8)
    > ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:="",
    > SubAddress:=actual, TextToDisplay:=ActiveCell.Value
    > End Sub
    >
    > Can anybody fix the above hyperlink macro pls.
    >
    > Thxs
    >




  5. #5
    Tom Ogilvy
    Guest

    Re: Hyperlink macro for personal.xls

    Here is a slight revision

    Sub Hyperlinkcell()
    '
    Dim actual As Range
    Dim Act_Cell as Range
    set Act_Cell = ActiveCell
    Set actual = Application.InputBox( _
    Prompt:="Select cell to hyperlink.", Type:=8)
    ActiveSheet.Hyperlinks.Add _
    Anchor:=Act_Cell, _
    Address:="", _
    SubAddress:="'" & actual.Parent.Name & _
    "'!" & actual.Address(0, 0), _
    TextToDisplay:=actual.Parent.Name & _
    "!" & actual.Address(0, 0)
    End Sub

    --
    Regards,
    Tom Ogilvy


    "Tom Ogilvy" <twogilvy@msn.com> wrote in message
    news:e7Dljb$%23FHA.2392@TK2MSFTNGP09.phx.gbl...
    > Sub Hyperlinkcell()
    > '
    > Dim actual As Range
    >
    > Set actual = Application.InputBox( _
    > Prompt:="Select cell to hyperlink.", Type:=8)
    > ActiveSheet.Hyperlinks.Add _
    > Anchor:=Selection, _
    > Address:="", _
    > SubAddress:="'" & actual.Parent.Name & _
    > "'!" & actual.Address(0, 0), _
    > TextToDisplay:=actual.Text
    > End Sub
    >
    >
    > --
    > Regards,
    > Tom Ogilvy
    >
    >
    > "al007" <transferxxx@gmail.com> wrote in message
    > news:1134041437.581886.78060@g44g2000cwa.googlegroups.com...
    > > Sub Hyperlinkcell()
    > > '
    > > Dim actual As Range
    > >
    > > Set actual = Application.InputBox(Prompt:="Select cell to
    > > hyperlink.", Type:=8)
    > > ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:="",
    > > SubAddress:=actual, TextToDisplay:=ActiveCell.Value
    > > End Sub
    > >
    > > Can anybody fix the above hyperlink macro pls.
    > >
    > > Thxs
    > >

    >
    >




  6. #6
    al007
    Guest

    Re: Hyperlink macro for personal.xls

    Thxs tom,
    Your code is working great & am using it for empty cells & using
    SubAddress:=activecell.value for non empty cells with an if statement
    cheers!!!



    Tom Ogilvy wrote:
    > Here is a slight revision
    >
    > Sub Hyperlinkcell()
    > '
    > Dim actual As Range
    > Dim Act_Cell as Range
    > set Act_Cell = ActiveCell
    > Set actual = Application.InputBox( _
    > Prompt:="Select cell to hyperlink.", Type:=8)
    > ActiveSheet.Hyperlinks.Add _
    > Anchor:=Act_Cell, _
    > Address:="", _
    > SubAddress:="'" & actual.Parent.Name & _
    > "'!" & actual.Address(0, 0), _
    > TextToDisplay:=actual.Parent.Name & _
    > "!" & actual.Address(0, 0)
    > End Sub
    >
    > --
    > Regards,
    > Tom Ogilvy
    >
    >
    > "Tom Ogilvy" <twogilvy@msn.com> wrote in message
    > news:e7Dljb$%23FHA.2392@TK2MSFTNGP09.phx.gbl...
    > > Sub Hyperlinkcell()
    > > '
    > > Dim actual As Range
    > >
    > > Set actual = Application.InputBox( _
    > > Prompt:="Select cell to hyperlink.", Type:=8)
    > > ActiveSheet.Hyperlinks.Add _
    > > Anchor:=Selection, _
    > > Address:="", _
    > > SubAddress:="'" & actual.Parent.Name & _
    > > "'!" & actual.Address(0, 0), _
    > > TextToDisplay:=actual.Text
    > > End Sub
    > >
    > >
    > > --
    > > Regards,
    > > Tom Ogilvy
    > >
    > >
    > > "al007" <transferxxx@gmail.com> wrote in message
    > > news:1134041437.581886.78060@g44g2000cwa.googlegroups.com...
    > > > Sub Hyperlinkcell()
    > > > '
    > > > Dim actual As Range
    > > >
    > > > Set actual = Application.InputBox(Prompt:="Select cell to
    > > > hyperlink.", Type:=8)
    > > > ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:="",
    > > > SubAddress:=actual, TextToDisplay:=ActiveCell.Value
    > > > End Sub
    > > >
    > > > Can anybody fix the above hyperlink macro pls.
    > > >
    > > > Thxs
    > > >

    > >
    > >



+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1