Excel超链接-跳至单元格并滚动窗口 [英] Excel Hyperlink - jump to cell and scroll window

查看:185
本文介绍了Excel超链接-跳至单元格并滚动窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在excel中工作,我想从页面顶部到页面上的另一个位置建立一个超链接.

I am working in excel and I want to make a Hyper Link from the top of the page to another location on the page.

我在顶部输入一个框,然后右键单击链接,然后在下拉菜单中转到hyper link,然后单击它,然后选择显示在此工作簿中"的选项卡,然后将其更改为所需的位置去.因此,所有这些都很好,除了我的问题之外,所有问题都是:

I type in a box at the top, and then right link and go down to hyper link in the dropdown menu I click it and select the tab that says "In This Work Book" and change it to where I want it to go. So all this is good and all but my Question is:

我可以建立一个超级链接以将我带到一个单元格并滚动窗口,以便所选单元格是第一行,而不是靠近窗口底部吗?

Can I make a Hyper link to bring me to a cell and scroll the window so the selected cell is the first row, instead of being near the bottom of the window?

示例:

超级链接:测试"位于单元格A,1中

Hyper link: "Test" Located in Cell A,1

超链接的位置:A,210

Location Of Hyper Link: A,210

现在,与其将A,210放在最底部并显示其上方的单元格,不如让它位于顶部并显示其下方的单元格.

Now instead of having it put A,210 at the very Bottom and show the cells above it, I want to to be at the top and show the cells below it.

感谢您的帮助

推荐答案

将以下VBA代码添加到工作表中:

Add the following VBA code to your worksheet:

Private Sub Worksheet_FollowHyperlink(ByVal Target As Hyperlink)
    ActiveWindow.ScrollRow = ActiveCell.Row
End Sub

通过魔术,当您单击链接时,该单元格将位于顶部.如果您不希望所有链接都有这种行为,则可以测试Target地址.

By magic, when you click a link, that cell will be at the top. If you don't want this behavior for all links, you can test the Target address.

您将必须将代码另存为xlsm文件,以便启用宏.使用Alt-F-11打开VBA编辑器,以便您实际上可以添加代码(双击左侧窗格中的工作表,然后将上面的代码粘贴到打开的窗口中).

You will have to save the code as a xlsm file so that macros are enabled. Use Alt-F-11 to open the VBA editor so you can actually add the code (double click the worksheet in the left hand pane, then paste the above code in the window that opens).

这篇关于Excel超链接-跳至单元格并滚动窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆