Consulting

Results 1 to 6 of 6

Thread: How to change the target of the hyperlinks in excel VBA ??

  1. #1
    VBAX Newbie aujing's Avatar
    Joined
    Jun 2006
    Location
    Hongkong
    Posts
    3

    Wink How to change the target of the hyperlinks in excel VBA ??

    How to change the target of the hyperlinks in excel VBA ??
    or could it be done...

  2. #2
    Administrator
    VP-Knowledge Base
    VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    Hi Aujing,
    Welcome to VBAX.
    This should change the hyperlink in the active cell as specified, changing the desciption as well. The basic code for this can be seen by making the cell active and recording the changes you wish to make.
    Regards
    MD

    [VBA]
    With ActiveCell
    .Formula = "Portal"
    .Hyperlinks(1).Address = "http://vbaexpress.com/portal.php"
    End With

    [/VBA]
    MVP (Excel 2008-2010)

    Post a workbook with sample data and layout if you want a quicker solution.


    To help indent your macros try Smart Indent

    Please remember to mark threads 'Solved'

  3. #3
    VBAX Newbie aujing's Avatar
    Joined
    Jun 2006
    Location
    Hongkong
    Posts
    3

    Unhappy

    oops,, thanks for your help,,
    but I mean the target of the hyperlinks,, not the href of the links...

  4. #4
    Administrator
    VP-Knowledge Base VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    What type of file is the target, and how do you wish to change it?
    MVP (Excel 2008-2010)

    Post a workbook with sample data and layout if you want a quicker solution.


    To help indent your macros try Smart Indent

    Please remember to mark threads 'Solved'

  5. #5
    VBAX Newbie aujing's Avatar
    Joined
    Jun 2006
    Location
    Hongkong
    Posts
    3
    <a href="http://abc.com/index.html" target="abc">
    I am using excel to prepare a calendar,,
    and using VBA to export to a html file..
    which contains some hyperlinks in it,, but I need to set the target of the hyperlinks to a specific frame..

    I am thinking if excel VBA support this change of target... ...

  6. #6
    Administrator
    VP-Knowledge Base VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    Not something I'm familiar with I'm afraid, but I'm sure someone else can assist.
    MVP (Excel 2008-2010)

    Post a workbook with sample data and layout if you want a quicker solution.


    To help indent your macros try Smart Indent

    Please remember to mark threads 'Solved'

Posting Permissions

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