How to email to a email address inside a textbox

Pookiemeister

Well-known Member
Joined
Jan 6, 2012
Messages
626
Office Version
  1. 365
  2. 2010
Platform
  1. Windows
I have button on my form that I would like use to open outlook to send an email to the person inside the textbox which is labeled "Email", as a start. Thank you.
 

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.
@JEC

One more thing about your code above. The following shortened code does not work as expected. It always goes to the Case Else condition there needs to be an AND with Case Is like in the original code but Case does not allow an AND.

VBA Code:
Select Case Time
    Case Is < "12:00:59": Salutation = "Good morning "
    Case Is < "16:59:59": Salutation = "Good afternoon "
    Case Is < "20:59:59": Salutation = "Good evening "
    Case Else: Salutation = "Dear "
 End Select
 
Upvote 0
Here it works. You don't need an And.
Same result this way?

VBA Code:
Select Case Time
    Case Is < TimeValue("12:00:59"): Salutation = "Good morning "
    Case Is < TimeValue("16:59:59"): Salutation = "Good afternoon "
    Case Is < TimeValue("20:59:59"): Salutation = "Good evening "
    Case Else: Salutation = "Dear "
 End Select
 
Upvote 0
@JEC

One more thing about your code above. The following shortened code does not work as expected. It always goes to the Case Else condition there needs to be an AND with Case Is like in the original code but Case does not allow an AND.

VBA Code:
Select Case Time
    Case Is < "12:00:59": Salutation = "Good morning "
    Case Is < "16:59:59": Salutation = "Good afternoon "
    Case Is < "20:59:59": Salutation = "Good evening "
    Case Else: Salutation = "Dear "
 End Select
Works for me also at 16:29 with Good afternoon ?
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,177
Members
453,021
Latest member
Justyna P

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