ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Possible to create 300+ hyperlinks to run the same VBA code? (https://www.excelbanter.com/excel-programming/366628-possible-create-300-hyperlinks-run-same-vba-code.html)

CodeKid

Possible to create 300+ hyperlinks to run the same VBA code?
 
The code that I want to run is very simple -- it takes the text of the cell
containing the hyperlink and copies it a specific range. It also selects the
specific range.

For example -- a list of 300+ symbols in one column:

ABC
DEF
HIJ

The code I need will convert the text to a hyperlink (I have this part
solved) and when the hyperlink for any of the symbols listed is clicked, it
will copy, for example, "ABC" to another cell and select the other cell that
now contains the copied text.

Any help you can offer would be greatly appreciated!

-CodeKid



Tom Ogilvy

Possible to create 300+ hyperlinks to run the same VBA code?
 
Use the FollowHyperlink Event. Right click on the sheet tab, select view
code, select it from the dropdowns at the top of the module.

--
Regards,
Tom Ogilvy


"CodeKid" wrote:

The code that I want to run is very simple -- it takes the text of the cell
containing the hyperlink and copies it a specific range. It also selects the
specific range.

For example -- a list of 300+ symbols in one column:

ABC
DEF
HIJ

The code I need will convert the text to a hyperlink (I have this part
solved) and when the hyperlink for any of the symbols listed is clicked, it
will copy, for example, "ABC" to another cell and select the other cell that
now contains the copied text.

Any help you can offer would be greatly appreciated!

-CodeKid



CodeKid

Possible to create 300+ hyperlinks to run the same VBA code?
 
Could you be more specific? I understand this is where the code should appear
but how do I pass the value from the cell with the hyperlink to the cell
selected after the hyperlink is clicked?

Thanks again for your assistance.

-CodeKid


"Tom Ogilvy" wrote:

Use the FollowHyperlink Event. Right click on the sheet tab, select view
code, select it from the dropdowns at the top of the module.

--
Regards,
Tom Ogilvy


"CodeKid" wrote:

The code that I want to run is very simple -- it takes the text of the cell
containing the hyperlink and copies it a specific range. It also selects the
specific range.

For example -- a list of 300+ symbols in one column:

ABC
DEF
HIJ

The code I need will convert the text to a hyperlink (I have this part
solved) and when the hyperlink for any of the symbols listed is clicked, it
will copy, for example, "ABC" to another cell and select the other cell that
now contains the copied text.

Any help you can offer would be greatly appreciated!

-CodeKid




All times are GMT +1. The time now is 05:25 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com