ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Follow hyperlink to show form (https://www.excelbanter.com/excel-programming/415688-follow-hyperlink-show-form.html)

omsoft

Follow hyperlink to show form
 
I have the following code to add hyperlink to a cell.

Range("A" & i).Hyperlinks.Add Anchor:=Cells(i, 1), _
Address:="", TextToDisplay:=rs("RuleID").Value

Then in that same worksheet, i have the following code to show the form to
modify that rule.

Private Sub Worksheet_FollowHyperlink(ByVal Target As Hyperlink)

frmRuleModify.cmbRuleId.Value = Target.Range.Value
frmRuleModify.Show

End Sub

The problem is that, this worksheet which contains a set of rules found
based on specified criteria get deleted and recreated, each time a query is
done. Is there a way I can put the above code to follow hyperlink in a
module, so it does not get deleted each time?

Thanks.


All times are GMT +1. The time now is 10:32 PM.

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