Hello
I am trying to make a macro that, when pressing a hyperlink to another sheet on the same book, checks if the hyperlink is valid (ergo the sheet exists), and if it does not exist, copy a defined Template with the name given on a cell. This would have to work for a whole table.
The image shows the table I created, where the column P is column A, starting on 11 and colun P/N is column B, starting on 11. The idea is that if I click on the hyperlink on P/N GENERAL, the macro automatically checks if the sheet is created and if not, create it copying it from a template, and renaming using the value contained on the cell on the left side.
Example, I click on the hyperlink CM000000-000. If it is created, the hyperlink will take me to that sheet. If not, the macro will copy a "Template" and rename it to 100000_0 (value on the left of the hyperlink).
Same with all positions on the column P/N GENERAL
Additionally, if the value on the column P/N GENERAL contains a "-", a different template should be used for the copy. Let's say "Template2"
Thanks!
I am trying to make a macro that, when pressing a hyperlink to another sheet on the same book, checks if the hyperlink is valid (ergo the sheet exists), and if it does not exist, copy a defined Template with the name given on a cell. This would have to work for a whole table.
The image shows the table I created, where the column P is column A, starting on 11 and colun P/N is column B, starting on 11. The idea is that if I click on the hyperlink on P/N GENERAL, the macro automatically checks if the sheet is created and if not, create it copying it from a template, and renaming using the value contained on the cell on the left side.
Example, I click on the hyperlink CM000000-000. If it is created, the hyperlink will take me to that sheet. If not, the macro will copy a "Template" and rename it to 100000_0 (value on the left of the hyperlink).
Same with all positions on the column P/N GENERAL
Additionally, if the value on the column P/N GENERAL contains a "-", a different template should be used for the copy. Let's say "Template2"
Thanks!