View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
John Doe[_5_] John Doe[_5_] is offline
external usenet poster
 
Posts: 4
Default Script to add hyperlink to Excel cell containing text

Worked great, thank you very much for the assistance.


"Patrick Molloy" wrote in message
...
try

objXL.Cells(Row,Column+7).FormulaR1C1 =
"=HYPERLINK(""\\Server06\C$\Program Files\Veritas\NT\Data\"" & RC2,RC2)"
--
Patrick Molloy
Microsoft Excel MVP
---------------------------------
I Feel Great!
---------------------------------
"John Doe" wrote in message
news:wQ2ad.364260$Fg5.215460@attbi_s53...
Here is a portion of my script which runs a report against text file
backup logs and puts them in an Excel Spreadsheet.

ElseIf InStr(s, "Job Log: ") < 0 Then
objXL.Cells(Row,Column+6).Value = Mid(s, 10) (this enters the job
log file name BEXXX.TXT)

At this point I want to insert the Hyperlink at Row,Column+7 :
\\Server06\C$\Program Files\Veritas\NT\Data\BE001.TXT

I have a variable in my script (BEFolder) that includes the
\\Server06\C$\Program Files\Veritas\NT\Data\ path since the server
changes depending on the report.

So would something like this work?

objXL.Cells(Row,Column+7).Value = (=HYPERLINK ...BEFolder &
(Row,Column+7)

Pardon my lack of knowledge in scripting but I am new to scripting.

Thanks Again



"sebastienm" wrote in message
...
Hi,
No need of a script, you can use the HYPERLINK( path , displayed_text)
funtion:
Say column A contains the file names, eg: a2: BE001.TXT
-In B2: =HYPERLINK("\\Server06\C$\Program Files\Veritas\NT\Data\" & A2,
A2)
-Copy/Paste down this cell along the data
- you can even hide column A now if necessary (select column A, then
menu
Format Column Hide)

Regards,
Sebastien
"John Doe" wrote:

Would like to use Windows Script to add a hyperlink to a cell in Excel:

Example:

The cell contains BE001.TXT. I want to turn that entry into a
hyperlink to
\\Server06\C$\Program Files\Veritas\NT\Data\BE001.TXT while displaying
only
BE001.TXT in the cell.

Can this be done using Windows Scripting?

Please reply to the group -no emails.

Thanks in advance