Copy cell value(hyperlinked)from excel and paste to email body

Switto

New Member
Joined
Aug 2, 2018
Messages
14


Dear All,


I am trying to copy cell value, which has linked to website,from Excel sheet and paste it into email body. While all other paste functionis working however hyperlink is not pasted so I am not able to select the cell.


Please see the below code:


.HTMLBody = "Dear " + Cells(i, 8) + ","_


+"<br>" _


+"<br>" _


+"<b>" + "Client Name: " + "</b> " +Cells(i, 3) + "<br>" _


+ "<b>" + "Engagement:" + "</b> " + Cells(i, 5) + "<br>" _ helprequired on this line


+"<b>" + "AML Folder reviewed: " +"</b>" + Cells(i, 6) + "<br>" +"<br>" _


+ "Aquality review by xxxxxxxx of the above AML Folder, used to support your xxxxxx, has identified the following gaps, which must now be urgently rectified toensure compliance with xxxxxxx : " + "<br>" +"<br>" + "<br>" _


+"<b>" + "<u>" + "Information to begathered:" + "</b>" + "</u>" +"<br>" + "<br>" _


+ Cells(i,10)





Thanks for your help.


Warm regards,


Switto
 
Last edited:

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
please see the code:

Rich (BB code):
 .HTMLBody = "Dear " + Cells(i, 8) + "," _
            + "
" _
            + "
" _
            + "" + "Client Name: " + " " + Cells(i, 3) + "
" _
            + "" + "Engagement: " + " " + Cells(i, 5) + "(I require help hear)
" _
            + "" + "AML Folder reviewed: " + "" + Cells(i, 6) + "
" + "
" _
            + "A quality review by Risk Management of the above AML Folder, used to support your PACE engagement acceptance, has identified the following gaps, which must now be urgently rectified to ensure compliance with UK AML regulations: " + "
" + "
" + "
" _
            + "" + "" + "Information to be gathered:" + "" + "" + "
" + "
" _
            + Cells(i, 10)
 
Last edited:
Upvote 0
Hi All,
I have tried the below code to get the hyperlink from the excel:

Rich (BB code):
"Engagement: " + " " + "" + Cells(i, 5) + "" + "
"

It has hyperlinked the cell in the email body however instead of the actual web page address it is showing cell reference.


Any idea how to counter it and get the web page address listed in the excel.

****I don't know hy full code which contains "ahref code" not showing in the above code.


Many Thanks
Switto
 
Last edited:
Upvote 0
Hi see if this works

Code:
Cells(i, 5).Hyperlinks(1).Address
 
Upvote 0
Hi see if this works

Code:
Cells(i, 5).Hyperlinks(1).Address
Thanks for the code. Really appreciate it .
Code is working however it is not completely copying the hyperlink
Is it something to do with Subaddress as well. Not sure
 
Upvote 0
I don't know how to create a SubAddress - do tell, but there is code for it and I obviously haven't tested it.

Try
Code:
+ cells(i, 5).Hyperlinks(1).SubAddress
 
Last edited:
Upvote 0
I don't know how to create a SubAddress - do tell, but there is code for it and I obviously haven't tested it.

Try
Code:
+ cells(i, 5).Hyperlinks(1).SubAddress

Thanks for your response.
I have tested with Sub Address and it is showing the partial hyperlink.
My full hyperlink address is : https://defra-pace.ey.net/PACE/Default.aspx#/Assessment/23200151/Summary
While using .Address in the code, output is coming till :https://defra-pace.ey.net/PACE/Default.aspx#
and the rest half is coming while using the .Subaddress i.e /Assessment/23200151/Summary
any idea why this is happening ,it suppose to copy the entire hyperlink not just bits and pieces

Thanks again to look into this.
 
Upvote 0
Hi,

the idea is to use both and see if that works. Sorry that wasn't clear.

Cells(i, 5).Hyperlinks(1).Address + cells(i, 5).Hyperlinks(1).SubAddress
 
Upvote 0

Forum statistics

Threads
1,217,423
Messages
6,136,547
Members
450,020
Latest member
ddobrzynski

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top