I am trying to insert an If statement in a For loop but keep getting errors. Code is :
For i = 3 To lastRow
If Range("Q" & i).Value = "Data confirmed" Then Range("Q" & i).Value = ""
Else
sh.Cells(i, "Q").Hyperlinks.Add Anchor:=sh.Cells(i, "Q"), Address:="", _
SubAddress:="", TextToDisplay:="Click To Save"
End If
Next i
When the cell contains the value "Data Confirmed" , no hyperlink should be included and the value should be "" When there is no "Data confirmed" in the cell, a hyperlink should pop up ( see code after the "ELSE")
What am i doing wrong?
Aucun commentaire:
Enregistrer un commentaire