Userform textbox email address not 'live' link after transfer to worksheet

AyurvedaPura

New Member
Joined
Jan 4, 2012
Messages
44
Hi All

I have a userform where users enter name, email and telephone details then click a commandbutton to transfer values to a worksheet after finding the first blank row in a range. Here is the code:

Code:
Dim wsEnrol as Worksheet
Dim irow as Long

Set wsEnrol = Sheets("Enrol Schedule")irow = wsEnrol.Range("A57").End(xlUp).Offset(1, 0).Row


Application.ScreenUpdating = False


With wsEnrol
    .Range("A" & irow) = FullName
    .Range("B" & irow) = Email
    .Range("C" & irow) = Tel
    .Range("D" & irow) = StartDate


End With

The thing is, the email address doesn't appear on the worksheeet as a live link - its just the text. If I enter the cell and press enter, it recognises it as an email adddress and makes it a link, but how do I make it do this from vba?

It doesn't have to appear on the userform, but in the sheet i need the email address to be an email address, not text that looks like one but cannot be clicked without first entering the cell and pressing Enter.

Many thanks for any assistance with this, I'm sure it must be simple but I can't seem to find anything useful searching around.

Best wishes

Daniel
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
Daniel the email address would need to have MailTo: before the entry to make this work so you can click on it and it sends an email address so perhaps this will resolve it, change your line

.Range("B" & irow) = Email

To

.Range("B" & irow) = "MailTo:" & Email
</pre>
 
Upvote 0
@Trever that still won't resolve automatically, you need to insert it as a hyperlink:
Code:
With wsEnrol    
    .Range("A" & irow) = FullName
    .Hyperlinks.Add .Range("B" & irow), Email, , , Email
    .Range("C" & irow) = Tel
    .Range("D" & irow) = StartDate
End With
 
Upvote 0
Kyle, thanks a lot!!

Once I removed that period before 'Range' in your formula, it works a treat.

So it should read:
Code:
[LEFT][COLOR=#333333]With wsEnrol    [/COLOR][/LEFT]
    .Range("A" & irow) = FullName 
   .Hyperlinks.Add Range("B" & irow), Email, , , Email 
   .Range("C" & irow) = Tel 
   .Range("D" & irow) = StartDate
End With

Big help, thanks!
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,228
Messages
6,170,871
Members
452,363
Latest member
merico17

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