Forum Discussion

kobus1305's avatar
kobus1305
Brass Contributor
Oct 16, 2020
Solved

Switching/Opening worksheets across 2 workbooks

Hi, I have workbook1 and workbook2 each with 12 worksheets one for each month January, February etc....... I open workbook1 first and at some time open or switch, if it is already open, to workbook2 by using in a cell HYPERLINK("Quotation Unit Prices.xlsm"). Is there a way that i can open or switch to workbook2 in the same worksheet that i were in workbook1????

Thank You

Regards

  • Hi kobus1305,

     

    Try this:

    =HYPERLINK("[c:\test\excel\destination.xlsx]"&MID(CELL("filename",A1),FIND("]",CELL("filename",A1))+1,255)&"!A1","destination")

     Obviously, you will need to change "c:\test\excel\destination.xlsx" for your path and your filename.

    This will grab the sheet name you are currently in and will open the same sheet in your destination workbook.

11 Replies

  • Bennadeau's avatar
    Bennadeau
    Iron Contributor

    Hi kobus1305,

     

    Try this:

    =HYPERLINK("[c:\test\excel\destination.xlsx]"&MID(CELL("filename",A1),FIND("]",CELL("filename",A1))+1,255)&"!A1","destination")

     Obviously, you will need to change "c:\test\excel\destination.xlsx" for your path and your filename.

    This will grab the sheet name you are currently in and will open the same sheet in your destination workbook.

    • kobus1305's avatar
      kobus1305
      Brass Contributor

      Bennadeau 

      Hi, Thank you so much for your response. I do not think I have expressed the situation so very well. I am going to forward the workbook to you. You will see in column header "Open Quotation Unit Prices" is the hyperlinks on each worksheet. That means when workbook "Quotation Unit Prices" is opened that hyperlink knows on which worksheet it is and which worksheet to open on. My Hyperlink do not have a path name in it because the files is in the same directory on the hard drive. I just can not figure out how to format the Hyperlink function to accomplish it.

      Regards

      Thank You

      • Bennadeau's avatar
        Bennadeau
        Iron Contributor

        kobus1305 

        Hi,

        You sent "Quotation Program". I'm assuming you have another workbook named "Quotation unit price" somewhere, right? Sorry I'm a bit confused, I feel like I'm missing some info.

        Either way, the following will give you the name of the current worksheet:

        =MID(CELL("filename",A1),FIND("]",CELL("filename",A1))+1,255)

        So, in my previous post, I concatenate it in the hyperlink formula. that way, if you are in workbook "ABC.xlsx", in sheet "august" the link will open workbook "DEF.xlsx" in sheet "august" You can remove the path for the filename if you want but leaving it there won't hurt. 

        So, if you can send me the other missing file, tell me exactly where and in which workbook & worksheet you want the link to be (give me the actual cell. e.g."E1") I'll be able to better assist you.