如何知道何时使用事件将新的超链接添加到工作表中



我需要我的代码来自动改变我新创建的超链接名称的字体,并改变它的其他字体属性,所以我需要我的代码来检测当一个新的超链接被添加到一个工作表

"Worksheet_Change"one_answers";Worksheet_FollowHyperlink"没有帮助。

更新:这是我的代码:

Private Sub Worksheet_Change(ByVal Target As Range)
Dim WB As Workbook
Dim WS As Worksheet
Dim TA As ListObject
Dim TA_DateCol As ListColumn
Set WB = ThisWorkbook
Set WS = WB.Sheets(1)
Set TA = WS.ListObjects(1)
If Not Intersect(Target, TA.Range) Is Nothing Then
'This is the part which I want my code to detect if a new hyperlink
'is added but nothing happens my guess is it's because 'Target' type
'in this event handler is a 'Range' not a 'Hyperlink'
End If
End Sub

任何帮助和建议将不胜感激。到目前为止我的代码的图片

向区域添加超链接不会触发worksheet_change事件。

因此它不能通过代码检测到这个。

解决方案是更新工作簿的超链接样式以满足您的要求。

有很多教程解释如何做到这一点,例如https://support.microsoft.com/en-us/office/change-the-font-format-for-hyperlinks-672c2905-ad3e-40be-b281-811e68386243

最新更新