Reputation: 284
Range("D2").Formula = "=IF(C2>0,HYPERLINK(\\\Haroon-pc\d\DatabaseCNIC\"&C2&".png",C2),"")"
my excel formula has ampersand, slashes. quotes etc. How to set Range("D2").Formula" with above formula.
Please someone write it for me in proper format.
Upvotes: 3
Views: 93
Reputation: 96791
Consider:
Sub qwerty()
Range("D2").Formula = "=IF(C2>0,HYPERLINK(""\\\Haroon-pc\d\DatabaseCNIC\.png"",C2),"""")"
End Sub
Upvotes: 3