Home > Enterprise >  Writing a hyperlink field to another sheets range within a loop using VBA
Writing a hyperlink field to another sheets range within a loop using VBA

Time:10-23

I am currently trying to get VBA syntax for writing Hyperlink to a range on an existing worksheet. I have code that I believe should work, but I just can't seem to manage to get it to work how it should. Any help with this would be great. Below is the code that I can't understand why it isn't working.

Sheets("EmailDataOutput").Hyperlinks.Add anchor:=Sheets("EmailDataOutput").Range("h" & outputrow), Address:="https://rocketsutoledo.sharepoint.com/sites/pwa/Project Detail Pages/Schedule.aspx?ProjUid=" & projid, ScreenTip:="", TexToDisplay:="Click here to go to Project"

Thanks in advance for any help,

Jacob

CodePudding user response:

Note: You have two variables in this code outputrow and projid that you should put values for them.

With Worksheets("EmailDataOutput") 
 .Hyperlinks.Add Anchor:=.Range("h" & outputrow), _ 
 Address:="https://rocketsutoledo.sharepoint.com/sites/pwa/Project Detail Pages/Schedule.aspx?ProjUid=" & projid, _  
 ScreenTip:="", _
 TextToDisplay:="Click here to go to Project" 
End With
  • Related