+ Reply to Thread
Results 1 to 2 of 2

Send Userform Data via Outlook Email

  1. #1
    Registered User
    Join Date
    06-19-2015
    Location
    Southend
    MS-Off Ver
    2013
    Posts
    2

    Send Userform Data via Outlook Email

    Hi,

    I am new to vba userforms but have created a few which allow the user to input data into several fields using text boxes and combo boxes.

    Once they have filled the form in, I have set a command button which transfers the data to a worksheet. What I would also like this command button to do is to send the data fields to an email address, in the body of the email.

    Is there anybody who could give me some guidance, I would be very grateful.

    The text for the command button (cmdEnter) currently looks like this:

    Private Sub cmdEnter_Click()
    'Range("A9").Value = txtDate
    'Range("B9").Value = txtTime
    'Range("C9").Value = cboType
    'Range("D9").Value = txtInitials
    'Range("E9").Value = cbo06
    'Range("F9").Value = cboMid
    'Range("G9").Value = cbo24
    'Range("I9").Value = txtComments
    erow = Sheets("Runway Inspections").Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).Row
    Sheets("Runway Inspections").Cells(erow, 1).Value = txtDate.Text
    Sheets("Runway Inspections").Cells(erow, 2).Value = txtTime.Text
    Sheets("Runway Inspections").Cells(erow, 3).Value = cboType.Text
    Sheets("Runway Inspections").Cells(erow, 4).Value = txtInitials.Text
    Sheets("Runway Inspections").Cells(erow, 5).Value = cbo06.Text
    Sheets("Runway Inspections").Cells(erow, 6).Value = cboMid.Text
    Sheets("Runway Inspections").Cells(erow, 7).Value = cbo24.Text
    Sheets("Runway Inspections").Cells(erow, 9).Value = txtComments.Text
    Unload Me
    End Sub

    Many thanks
    Dan

  2. #2
    Registered User
    Join Date
    06-19-2015
    Location
    Southend
    MS-Off Ver
    2013
    Posts
    2

    Re: Send Userform Data via Outlook Email

    Since posting I have managed to figure this out but have hit on a new problem.

    When the text is entered into the body of the email, I would like each bit of data on a new line. How do I go about inserting line breaks with coding?

    Thanks
    Dan

+ 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. Send Email using UserForm Data
    By Rosco88 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-07-2015, 10:51 AM
  2. Send data table from Excel to outlook as Email
    By praky in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-16-2014, 04:31 PM
  3. send selected range in email with default outlook email signature included
    By mdsickler in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-04-2013, 10:50 PM
  4. Outlook send email from data in column from excel spreadsheet
    By benasalisbury in forum Outlook Programming / VBA / Macros
    Replies: 10
    Last Post: 03-16-2012, 02:24 AM
  5. Use data from a UserForm to send email
    By tanktata in forum Excel Programming / VBA / Macros
    Replies: 20
    Last Post: 06-11-2011, 03:11 PM

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