0
我正在使用下面的代碼嘗試將第I列中的每個文本值轉換爲超鏈接?VBA在每一行添加超鏈接?
的代碼產生一個錯誤類型不匹配整個這段代碼對:
.Hyperlinks.Add Anchor:=C.Address, _
Address:="\\Gb-ss04\001_data\QUALITY ASSURANCE\03_AUDITS\01 Lidl Standard\c Results\WG " & Left(Range("I" & C.Row), 2) & "\" & Range("O" & C.Row).Value, _
ScreenTip:=Range("O" & C.Row).Value, _
TextToDisplay:=Range("O" & C.Row).Value
請能有人告訴我在哪裏,我錯了?
代碼:
Sub Add()
Dim C As Range
With ActiveSheet
For Each C In .Range("O10:O" & .Range("O" & .Rows.Count).End(xlUp).Row)
.Hyperlinks.Add Anchor:=C.Address, _
Address:="\\Gb-ss04\001_data\QUALITY ASSURANCE\03_AUDITS\01 Lidl Standard\c Results\WG " & Left(Range("I" & C.Row), 2) & "\" & Range("O" & C.Row).Value, _
ScreenTip:=Range("O" & C.Row).Value, _
TextToDisplay:=Range("O" & C.Row).Value
Next C
End With
End Sub
你得到了什麼錯誤?看起來像theres錯誤在每個C ...' – krib
@ krib類型不匹配錯誤根據問題 – user7415328