excel vba - Hyperlink.add Anchor with .Cells instead of .Range -
i have code doesn't seem working shown below
with cells(emptyrow, 13) .hyperlinks.add anchor:=.cells(emptyrow, 13), _ address:=emaillinktextbox.value, texttodisplay:="link" end and believe due anchor because found description anchor stated can either range or shape object.
is issue, if there anyway make work?
thank you
as setting anchor address .cells(emptyrow, 13) within with cells(emptyrow, 13) block (i.e. equivalent cells(emptyrow, 13).cells(emptyrow, 13), anchor being placed in cells(2 * emptyrow - 1, 2 * 13 - 1).
you want change anchor cells(emptyrow, 13) - i.e. replace code with:
with cells(emptyrow, 13) .hyperlinks.add anchor:=cells(emptyrow, 13), _ address:=emaillinktextbox.value, texttodisplay:="link" end or
with cells(emptyrow, 13) .hyperlinks.add anchor:=.cells(1, 1), _ address:=emaillinktextbox.value, texttodisplay:="link" end note: cell range object - it's has 1 x 1 size.
Comments
Post a Comment