Consulting

Results 1 to 6 of 6

Thread: TREE hYPERLICK UPDATE

  1. #1
    VBAX Regular
    Joined
    Nov 2007
    Posts
    14
    Location

    Hyperlink excel

    hi, im newbie using VBA.i need to design that,every time user change directory in excel,then the hyperlink we assign to the cell will automatically change to that folder.do anybody can help me .plz

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    [vba]

    Private Sub Worksheet_Change(ByVal Target As Range)
    Const WS_RANGE As String = "H1:H10" '<== change to suit

    On Error GoTo ws_exit
    Application.EnableEvents = False

    If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
    With Target
    .Hyperlinks.Add Anchor:=Selection, _
    Address:=.Value, _
    TextToDisplay:=.Value
    End With
    End If

    ws_exit:
    Application.EnableEvents = True
    End Sub
    [/vba]

    This is worksheet event code, which means that it needs to be
    placed in the appropriate worksheet code module, not a standard
    code module. To do this, right-click on the sheet tab, select
    the View Code option from the menu, and paste the code in.


    __________________________________________
    UK Cambridge XL Users Conference 29-30 Nov
    http://www.exceluserconference.com/UKEUC.html
    Last edited by Bob Phillips; 11-22-2007 at 02:11 AM.
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  3. #3
    VBAX Regular
    Joined
    Nov 2007
    Posts
    14
    Location
    tq very much.i try to execute .but nothing happen.can u guide me the step.thanks again

  4. #4
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Type the link in cell H1 and it should auto-hyperlink


    __________________________________________
    UK Cambridge XL Users Conference 29-30 Nov
    http://www.exceluserconference.com/UKEUC.html
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  5. #5
    VBAX Regular
    Joined
    Nov 2007
    Posts
    14
    Location
    i would to design code that update the hyperlink everytime user change the folder.like we assign userform,that user need to key in the folder that consist information at(C:\Documents and Settings\asrul\Desktop\AP note).later all hyperlink data(C:\Documents and Settings\asrul\Desktop\AP note\Ap_Notes\A004R.pdf).so that whenver user change folder like E:\Documents and Settings\asrul\Desktop\AP note) and the hyperlink data in cell also will be like (E:\Documents and Settings\asrul\Desktop\AP note\Ap_Notes\A004R.pdf).Is it possible.i need help.plz

  6. #6
    VBAX Regular
    Joined
    Nov 2007
    Posts
    14
    Location

    TREE hYPERLICK UPDATE

    i would to design code that update the hyperlink everytime user change the folder.like we assign userform,that user need to key in the folder that consist information at(C:\Documents and Settings\asrul\Desktop\AP note).later all hyperlink data(C:\Documents and Settings\asrul\Desktop\AP note\Ap_Notes\A004R.pdf).so that whenver user change folder like E:\Documents and Settings\asrul\Desktop\AP note) and the hyperlink data in cell also will be like (E:\Documents and Settings\asrul\Desktop\AP note\Ap_Notes\A004R.pdf).Is it possible.i need help.plz

Posting Permissions

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