VBA error for textbox email address into address

Patriot2879

Well-known Member
Joined
Feb 1, 2018
Messages
1,227
Office Version
  1. 2010
Platform
  1. Windows
Hi, i got the code below where it autofills a email address in to textbox36 and i want this data to link into my email, i have used the code below but i get an error please can you help

Code:
aEmail.Recipients.Add = "UserForm1.TextBox36.Value"
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
Re: VBA error for texbox email address into address

Dont put quotes around the textbox....it cant resolve this way, instead:
aEmail.Recipients.Add = UserForm1.TextBox36.Value
 
Upvote 0
Re: VBA error for texbox email address into address

hi thanks for that but unfortuantely i am still getting the error, below is the code i changed it too, i am getting a Run-Time error '499': Argument not optional, please can you help :) thank you in advance.
Code:
aEmail.Recipients.Add = UserForm1.TextBox36.Value
 
Upvote 0
Re: VBA error for texbox email address into address

Hi

does this do it?

Code:
aEmail.Recipients.Add(UserForm1.TextBox36.Value)
 
Upvote 0
Re: VBA error for texbox email address into address

Yes :) that works great thank you so much :)
 
Upvote 0
Re: VBA error for texbox email address into address

thank you for that :)
 
Upvote 0

Forum statistics

Threads
1,214,515
Messages
6,119,972
Members
448,933
Latest member
Bluedbw

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