Excel VBA

A macro I used to creat the hyperlinks to another sheet which is in sequence

Sub CreateLinks()


Dim i, j, NoNeeded As Integer

i = 19 'copy source start row

j = 2 'copy destination start row

NoNeeded = 500 'number of links

Dim cellSelect As String

Dim cellTarget As String
For j = 2 To NoNeeded

cellSelect = "A" & CStr(j)

Range(cellSelect).Select

cellTarget = "!A" & CStr(i)
ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:="", SubAddress:=_ "'UNKNOWN (1)'" & cellTarget, TextToDisplay:="'UNKNOWN (1)'" & cellTarget

i = i + 1

Next j


End Sub

Comments

Popular posts from this blog

Outlook : "operation failed, object could not be found. " when trying to close a PST.

How to transfer app and data from old iPhone to new iPhone for model IOS17 and IOS18 above.

Troubleshooting Outlook Express (IMAP, POP3, HTTP, NEWS) with the log file