![]() |
make Hyperlink jump on the top row
All,
I have quite a few hyperlinks in a workbook. Some of them are in cells and some in objects. When I click on the hyperlinked cell or object i want that cell to become the top row. I was able to solve the problem for hyperlinks in the cell by using the following code Private Sub Worksheet_FollowHyperlink(ByVal Target As Hyperlink) ActiveWindow.ScrollRow = ActiveCell.Row End Sub Problem is that this does not work for hyperlinks in the objects. is there a way to make the hyperlinked cell become the top row when hyperlink is residing in an object such as a square or a rectangle. Thanks much in advance. RK |
make Hyperlink jump on the top row
since follow hyperlink event not fire when shape clicked and since if you
have hyprlink in a shape the macro assigned to that shape not run i think you shoud get rid of link and instead just assign macro to shape. this a expl Sub ObjFollowHyperlink() Select Case Application.Caller Case "Rectangle 1" Application.Goto Range("J1"), True Case "Rectangle 2" Application.Goto Range("P15"), True End Select End Sub "rk0909" wrote in message ... | All, | | I have quite a few hyperlinks in a workbook. Some of them are in cells and | some in objects. When I click on the hyperlinked cell or object i want that | cell to become the top row. | | I was able to solve the problem for hyperlinks in the cell by using the | following code | | Private Sub Worksheet_FollowHyperlink(ByVal Target As Hyperlink) | ActiveWindow.ScrollRow = ActiveCell.Row | End Sub | | Problem is that this does not work for hyperlinks in the objects. is there | a way to make the hyperlinked cell become the top row when hyperlink is | residing in an object such as a square or a rectangle. | | Thanks much in advance. | | RK |
make Hyperlink jump on the top row
thanks. this works great.
"Homey" wrote: since follow hyperlink event not fire when shape clicked and since if you have hyprlink in a shape the macro assigned to that shape not run i think you shoud get rid of link and instead just assign macro to shape. this a expl Sub ObjFollowHyperlink() Select Case Application.Caller Case "Rectangle 1" Application.Goto Range("J1"), True Case "Rectangle 2" Application.Goto Range("P15"), True End Select End Sub "rk0909" wrote in message ... | All, | | I have quite a few hyperlinks in a workbook. Some of them are in cells and | some in objects. When I click on the hyperlinked cell or object i want that | cell to become the top row. | | I was able to solve the problem for hyperlinks in the cell by using the | following code | | Private Sub Worksheet_FollowHyperlink(ByVal Target As Hyperlink) | ActiveWindow.ScrollRow = ActiveCell.Row | End Sub | | Problem is that this does not work for hyperlinks in the objects. is there | a way to make the hyperlinked cell become the top row when hyperlink is | residing in an object such as a square or a rectangle. | | Thanks much in advance. | | RK . |
All times are GMT +1. The time now is 10:08 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com