【发布时间】:2016-12-20 05:48:36
【问题描述】:
【问题讨论】:
标签: excel excel-formula conditional-formatting vba
【问题讨论】:
标签: excel excel-formula conditional-formatting vba
使用Hyperlink.SubAddess 获取对其目标范围的引用。接下来复制目标范围并使用Hyperlink.PasteSpecial xlPasteFormats 复制所有格式。如果您只需要条件格式,则必须迭代目标的 FormatConditions。
Sub ProcessHyperlinks()
Dim h As Hyperlink
Dim ws As Worksheet
For Each ws In ActiveWorkbook.Worksheets
For Each h In ws.Hyperlinks
If h.SubAddress <> "" Then
On Error Resume Next
h.Range.FormatConditions.Delete
Range(h.SubAddress).Copy
h.Range.PasteSpecial xlPasteFormats
On Error GoTo 0
End If
Next
Next
End Sub
【讨论】: