【发布时间】:2021-01-13 02:23:42
【问题描述】:
这一系列命令似乎导致Runtime Error: 1004 我想知道这个错误的原因是什么。
如果我没有 Activesheet.Hyperlinks.add 行,则单元格值设置正确,只是缺少超链接...这会让我觉得我丢失了 xCell 引用,但我之前已经放置了调试语句hyperlink.add 似乎可以访问。
For Each xCell In Selection
Url = xCell.Value
If Url = "" Then
'Do Nothing
ElseIf IsEmpty(xCell) = True Then
'Do Nothing
ElseIf IsEmpty(Url) = False Then
splitArr = Split(Url, "/")
sku = splitArr(UBound(splitArr))
xCell.Value = "https://www.brickseek.com/walmart-inventory-checker?sku=" & sku
'Error happens on next command
ActiveSheet.Hyperlinks.Add Anchor:=xCell, Address:=xCell.Formula
End If
Next xCell
【问题讨论】: