ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Adding hyperlink after the existing data in the cell (https://www.excelbanter.com/excel-programming/326451-adding-hyperlink-after-existing-data-cell.html)

helpwithXL

Adding hyperlink after the existing data in the cell
 
Hi all,
Is it possible to create and add the hyperlink after the existing data
in the cell(that is, in the next line after the existing data in the
same cell). So what i'm trying to do is, to get an outlook email, store
email as .msg file in my folder and then add hyperlink to the just
stored file in a particular cell in my worksheet. I can do all the
things except for appending the hyperlink. As i create the hyperlink
and add it in the cell selected by user, all the data in that cell is
just overwritten by the hyperlink. So after this i only have the
hyperlink in the cell and all the data that was there in the cell is
lost. so is it possible to keep both , the existing data and hyperlink
added in the cell.
i tried reading the data of the cell into a variable before creating
and adding hyperling. then i added the hyperlink in the cell. then i
concatenated the data and hyperlink and then i made this concatination
as the value of cell. but with this process, all the data is converted
into the hyperlink, that is data that was there before the hyperlink is
also a part of hyperlink text now. so is it possible to have normal
text and hyperlink together in 1 cell.
my code is....

existingData = SelCells(j).Value
ActiveSheet.Hyperlinks.Add Anchor:=SelCells(j), _
Address:=FullPath, TextToDisplay:=Filename
hyperlinkString = SelCells(j).Value
SelCells(j).Value = existingData & vbCrLf & hyperlinkString


thanx for any help
amit



All times are GMT +1. The time now is 02:31 AM.

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