ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Generating a Hyperlink Macro (https://www.excelbanter.com/excel-programming/291145-generating-hyperlink-macro.html)

Andy Weller

Generating a Hyperlink Macro
 
Dear all,

I have a spreadsheet with the following data:

Column A B C D
E:\HALCONtemp\ASP12.2\ -13438 -50576 8030
E:\HALCONtemp\ASP12.2\ -13445 -48132 8940
E:\HALCONtemp\ASP12.2\ -13451 -51858 7830
....

I am a somewhat newbie and am trying to generate a macro that will
enable me to hyperlink each Row in Column A and open the associated file.

So, in the example above, the folder 'E:\HALCONtemp\ASP12.2\' has the
file '-13438_-50576_8030.tif' that I would like to open (as a preview).

So, to generalise, Column A has the folder 'An' and I would like to open
the file 'Bn'_'Cn'_'Dn'.tif associated with it.

Hopefully that makes some sense. Any help would be greatly appreciated.

Andy


Tom Ogilvy

Generating a Hyperlink Macro
 
You don't need a macro.

in E1 put in the formula

=Hyperlink(A1&b1&"_"&C1&"_"&d1&".tif",B1&"_"&C1&"_ "&D1)

then drag fill down the column.

Adjust the concatentation to faithfully reproduce the full path of the file
(if my sample doesn't already) and alter the second argument to dipslay what
you want.

See Excel help on the Hyperlink worksheet function for details.

Regards,
Tom Oglivy

"Andy Weller" wrote in message
...
Dear all,

I have a spreadsheet with the following data:

Column A B C D
E:\HALCONtemp\ASP12.2\ -13438 -50576 8030
E:\HALCONtemp\ASP12.2\ -13445 -48132 8940
E:\HALCONtemp\ASP12.2\ -13451 -51858 7830
...

I am a somewhat newbie and am trying to generate a macro that will
enable me to hyperlink each Row in Column A and open the associated file.

So, in the example above, the folder 'E:\HALCONtemp\ASP12.2\' has the
file '-13438_-50576_8030.tif' that I would like to open (as a preview).

So, to generalise, Column A has the folder 'An' and I would like to open
the file 'Bn'_'Cn'_'Dn'.tif associated with it.

Hopefully that makes some sense. Any help would be greatly appreciated.

Andy





All times are GMT +1. The time now is 06:50 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com