Linking Help

N

Nik Majdan

Ok, I've got a little problem. I've got a large
spreadsheet serving as our Dependency Matrix for our
servers. Each server has an info text file that needs to
be linked on the spreadsheet. Manually typing them all out
will take a lot of time. Here's basically what I need:

Column A; Column B
SVR1; \\domain\dir\SVR1.txt
SVR2; \\domain\dir\SVR2.txt

Is there a macro that will read the name of the server
(content of column A starting in row 2) and insert it into
a file path with the .txt inserted after it? And I do need
it to be a hyperlink with the text "Server Log." Thanks in
advance.
 
K

kkknie

Try:

Code
-------------------
Sub test()

Dim i As Long

For i = 1 To 10 'Change to your start and end rows

ActiveSheet.Hyperlinks.Add Anchor:=Range("B" & i), Address:= _
"\\domain\dir\" & Range("A" & i).Value & ".txt", TextToDisplay:="Server Log"

Next

End Su
-------------------
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top