[英]Change the a formula that appears on multiple worksheets in Excel
I have an Excel file that has about ~100 sheets that all contain the same 'main' button.我有一个 Excel 文件,里面有大约 100 张都包含相同的“主”按钮。 This button (which is actually a hyperlink) links to the main worksheet of the Excel file.此按钮(实际上是一个超链接)链接到 Excel 文件的主工作表。 When clicking the button, the main worksheet is opened and cell A1 is selected.单击该按钮时,将打开主工作表并选择单元格 A1。 The problem is that cell A1 and A2 contain an image, and when A1 is selected, this selection is partially "on top" of the image. The problem is that cell A1 and A2 contain an image, and when A1 is selected, this selection is partially "on top" of the image. Functionality wise this is not a problem but it does not look so nice optically.功能明智这不是问题,但它在视觉上看起来不太好。 This leads me to the follow questions:这使我想到以下问题:
So, you already know how to change one link.所以,您已经知道如何更改一个链接。 To change all, you may use a macro which:要更改所有内容,您可以使用一个宏:
like following:像下面这样:
Sub ChangeHyperlinks()
Dim w As Worksheet, s As Shape, h As Hyperlink
For Each w In ActiveWorkbook.Worksheets
For Each s In w.Shapes
Set h = Nothing
On Error Resume Next
Set h = s.Hyperlink
On Error GoTo 0
If Not h Is Nothing Then
If h.Address = "" And h.SubAddress = "Your_Main_Worksheet_Name!A5:B6" Then
h.SubAddress = "Your_Main_Worksheet_Name!A1:F61"
End If
End If
Next
Next
End Sub
The solution you are trying to achieve is pretty easy.您试图实现的解决方案非常简单。 Just follow the below steps只需按照以下步骤操作
Done...完毕...
Hope this helps !希望这可以帮助 !
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.