+ Reply to Thread
Results 1 to 11 of 11

Mail from userform in excel, content from textboxs and combobox

  1. #1
    Registered User
    Join Date
    11-19-2013
    Location
    Sarpsborg, Norway
    MS-Off Ver
    Excel 2013
    Posts
    2

    Mail from userform in excel, content from textboxs and combobox

    Hi,
    I'm new too vba and have lots too learne, but i need some help with my first "project"

    I have a userform i want to mail the textbox content from.
    The recipients would i like too use a mail adress from a combobox in the same userform and then represent the data in body.

    I have tried but i can only send mail with adress in the code not from textbox.

    I have 9 textboxes and 2 comboboxes i my userform.

    I hope someone can help me.

    Please Login or Register  to view this content.
    Last edited by Fotis1991; 11-26-2013 at 08:58 AM. Reason: pls use code tags around your codes

  2. #2
    Forum Expert Solus Rankin's Avatar
    Join Date
    05-24-2013
    Location
    Hollywood, CA
    MS-Off Ver
    Win7 Office 2010 VS Express 2012
    Posts
    2,655

    Re: Mail from userform in excel, content from textboxs and combobox

    Can you redact any sensitive information from your workbook and attach it as an example?

    To attach a workbook, click the 'Go Advanced' button below and use the paperclip in the toolbar to navigate to your workbook.
    Thanks,
    Solus


    Please remember the following:

    1. Use [code] code tags [/code]. It keeps posts clean, easy-to-read, and maintains VBA formatting.
    Highlight the code in your post and press the # button in the toolbar.
    2. Show appreciation to those who have helped you by clicking below their posts.
    3. If you are happy with a solution to your problem, mark the thread as [SOLVED] using the tools at the top.

    "Slow is smooth, smooth is fast."

  3. #3
    Registered User
    Join Date
    11-19-2013
    Location
    Sarpsborg, Norway
    MS-Off Ver
    Excel 2013
    Posts
    2

    Re: Mail from userform in excel, content from textboxs and combobox

    Hi,
    I have preperd a workbook as an example.

    As you can see in the code i want to save the data in a sheet after i have send it.
    Attached Files Attached Files

  4. #4
    Forum Expert Solus Rankin's Avatar
    Join Date
    05-24-2013
    Location
    Hollywood, CA
    MS-Off Ver
    Win7 Office 2010 VS Express 2012
    Posts
    2,655

    Re: Mail from userform in excel, content from textboxs and combobox

    I can't test it fully because I don't have excel 2013, but try: Excel%20forum(1).xlsm

  5. #5
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Mail from userform in excel, content from textboxs and combobox

    Hi perkb

    I haven't tested this but you need to loop and send, loop and send...
    Please Login or Register  to view this content.
    John

    If you have issues with Code I've provided, I appreciate your feedback.

    In the event Code provided resolves your issue, please mark your Thread as SOLVED.

    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

  6. #6
    Forum Expert Solus Rankin's Avatar
    Join Date
    05-24-2013
    Location
    Hollywood, CA
    MS-Off Ver
    Win7 Office 2010 VS Express 2012
    Posts
    2,655

    Re: Mail from userform in excel, content from textboxs and combobox

    @jaslake,

    I can't reopen the file. Somehow it got corrupted. Is that in reference to a mistake I made in coding?

  7. #7
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Mail from userform in excel, content from textboxs and combobox

    @Solus

    Both Files (yours and the OP's) open fine for me.

  8. #8
    Forum Expert Solus Rankin's Avatar
    Join Date
    05-24-2013
    Location
    Hollywood, CA
    MS-Off Ver
    Win7 Office 2010 VS Express 2012
    Posts
    2,655

    Re: Mail from userform in excel, content from textboxs and combobox

    @jaslake

    I meant the edit in the code. Did I make a mistake in my construct?

    I was under the impression there would only be one .To = and only one email sent for the most recently updated line.

  9. #9
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Mail from userform in excel, content from textboxs and combobox

    @Solus

    I honestly didn't look at your Code...I simply noticed that the OP's Code appears to be not looping correctly.

  10. #10
    Forum Expert Solus Rankin's Avatar
    Join Date
    05-24-2013
    Location
    Hollywood, CA
    MS-Off Ver
    Win7 Office 2010 VS Express 2012
    Posts
    2,655

    Re: Mail from userform in excel, content from textboxs and combobox

    If the OP only wants to send the last line updated to one individual why would you need to move Call SubmitEmail()?

    Perhaps I'm missing something.

  11. #11
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Mail from userform in excel, content from textboxs and combobox

    More than likely I am...I only looked briefly at the Code...

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] VBA Userform ComboBox: Content of ComboBox based off of Conditional Statement
    By Brianandstewie in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-16-2013, 03:00 PM
  2. [SOLVED] Excel Userform: Populate other controls (i.e. textbox & combobox) based on combobox select
    By MileHigh_PhD in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-22-2013, 04:50 PM
  3. Populating textboxs with resultsof combobox choice
    By Lensmeister in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-19-2012, 10:27 AM
  4. Looping through userform textboxs to make them visible
    By Alan Steele in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-04-2012, 02:19 PM
  5. help looping through textboxs on userform
    By funkymonkUK in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-22-2006, 06:19 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1