Vba add a link in a sheet to another sheet in Excel

For example I want to have in one sheet many links to various sheets of my worksheet

To do it in Excel, here is the answer:

Easy answer is to us the INSERT HYPERLINK command

excel vba add a link in a sheet to another sheet

excel vba add a link in a sheet to another sheet

But if you want to have many of them then, for example if you have an index of all the sheets in the first sheet. Then doing the insert hyperlink manually will be very tedious. So here how to do it.

In one cell of the first pagem enter the following line

  1. LEFT(CELL("filename"),FIND("[",CELL("filename"),1)-1)
  2. MID(CELL("filename"),SEARCH("[",CELL("filename"))+1, SEARCH("]",CELL("filename"))-SEARCH("[",CELL("filename"))-1)
  3. Q201
  4. A1
  5. HYPERLINK("file:///"&C42&C43& "#'"&C44&"'!$A$1", C44)

Description:

line 1 gives you the path of the file

line 2 gives you the name of the file

line 3 is the name of the sheet

line 4 combines this plus add the name of sheet that is in line 3

inspired by

https://www.extendoffice.com/documents/excel/1150-excel-insert-path-and-file-name.html

 

You can find similar Excel Questions and Answer hereunder

1) I have a macro that takes a lot of time for execution - how can I keep the user informed that the macro is running?

2) How to create Pivot table in excel VBA

3) How can I avoid updates to cell values during macro execution?

4) How can I turn off Alerts using VBA?

5) How to disable ability to insert Rows and Columns in Excel (using VBA)?

6) How to concatenate strings in vba in Excel

7) Vba list all files in a folder in Excel

8) How to delete rows with Excel VBA

9) Here some explanations about the MSXML who stands for Microsoft XML core services

10) String split in vba in Excel

 

Here the previous and next chapter