none
hyperlinks in excel sheet RRS feed

  • Question

  • how to create links and on click of the link, pointer has to move or open particular sheet
    Thursday, March 30, 2017 6:19 AM

All replies

  • Hi vanikalyani,

    please try to refer code below.

    Sub demo()
    Dim sh As Worksheet
    Dim cell As Range
    For Each sh In ActiveWorkbook.Worksheets
    
        If ActiveSheet.Name <> sh.Name Then
    
            ActiveCell.Hyperlinks.Add Anchor:=Selection, Address:="", SubAddress:="'" & sh.Name & "'" & "!A1", TextToDisplay:=sh.Name
    
            ActiveCell.Offset(1, 0).Select
    
        End If
    
    Next sh
    End Sub

    Output:

    Regards

    Deepak


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Friday, March 31, 2017 2:17 AM
    Moderator
  • Hi vanikalyani,

    I find that , since you created this thread you did not visit this thread again.

    I can see that suggestion can solve your issue.

    so please try to refer the suggestion and if you think that it can solve your issue then try to mark it as an answer.

    it will help us to close this thread.

    if you do not mark the answer then we are not able to close this thread. thread will be remain opened.

    Regards

    Deepak


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, April 10, 2017 7:16 AM
    Moderator
  • hi Deepak Panchal10,

      Thank you very much for the solution but I want the code using office javascript api.

    Regards,

    vani kalyani


    vani

    Thursday, April 13, 2017 9:23 AM
  • Hi vanikalyani,

    first I want to suggest you that when you post a question on any forum then try to describe your issue with as much as possible details.

    also try to post the issue on correct forum.

    like there is another forum for JavaScript object model for Excel.

    this forum only handles Excel VBA Object model related issue.

    so by default we assume that you are using VBA.

    you can refer code below and modify it as per your requirement.

    Excel.run(function (ctx) {
        var firstCellInSelection = ctx.workbook.getSelectedRange().getCell(0, 0);
        firstCellInSelection.formulas = [['=HYPERLINK("#Sheet2")']];
        return ctx.sync();
    }).catch(function (error) {
        console.log(error);
    });

    below is the link for javascript object model.

    Application Object (JavaScript API for Excel)

    next time you can post your issue in forum below.

    Developing Apps for Office

    Regards

    Deepak


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Friday, April 14, 2017 1:31 AM
    Moderator