Creating an email from a form in Excel

mcnemarl

New Member
Joined
Apr 1, 2011
Messages
4
I have a form generated by VB and I want to populate the contents entered by the user into the excel spreadsheet (this done) and then generate an email through a command button. Does anyone have any suggestions or links to where I can review how to do this. I was in class for basic VB.NET and I think this is slightly more advance. I would think that you would assign the fields to vars then send to outlook.
 

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
I can have a go if you post your file to a public share site like box.net. Post the file and then provide the link and I can take a look.
 
Upvote 0
I having problems with the box.net. This is what I was looking at. It generates the form through a button make booking but I also wanted the option to generate an email.

This workbook was prepared and coded by Martin Green to help
' Excel users learn about VBA. Visit my web site for tips and
' tutorials on Microsoft Office and details of my Training and
' Consultancy services: http://www.fontstuff.com
'==============================================================
Private Sub chkLunch_Change()
If chkLunch = True Then
chkVegetarian.Enabled = True
Else
chkVegetarian.Enabled = False
chkVegetarian = False
End If
End Sub
Private Sub cmdCancel_Click()
Unload Me
End Sub
Private Sub cmdClearForm_Click()
Call UserForm_Initialize
End Sub
Private Sub cmdOK_Click()
ActiveWorkbook.Sheets("Course Bookings").Activate
Range("A1").Select
Do
If IsEmpty(ActiveCell) = False Then
ActiveCell.Offset(1, 0).Select
End If
Loop Until IsEmpty(ActiveCell) = True
ActiveCell.Value = txtName.Value
ActiveCell.Offset(0, 1) = txtPhone.Value
ActiveCell.Offset(0, 2) = cboDepartment.Value
ActiveCell.Offset(0, 3) = cboCourse.Value
If optIntroduction = True Then
ActiveCell.Offset(0, 4).Value = "Intro"
ElseIf optIntermediate = True Then
ActiveCell.Offset(0, 4).Value = "Intermed"
Else
ActiveCell.Offset(0, 4).Value = "Adv"
End If
If chkLunch = True Then
ActiveCell.Offset(0, 5).Value = "Yes"
Else
ActiveCell.Offset(0, 5).Value = "No"
End If
If chkVegetarian = True Then
ActiveCell.Offset(0, 6).Value = "Yes"
Else
If chkLunch = False Then
ActiveCell.Offset(0, 6).Value = ""
Else
ActiveCell.Offset(0, 6).Value = "No"
End If
End If
Range("A1").Select
End Sub
Private Sub UserForm_Initialize()
txtName.Value = ""
txtPhone.Value = ""
With cboDepartment
.AddItem "Sales"
.AddItem "Marketing"
.AddItem "Administration"
.AddItem "Design"
.AddItem "Advertising"
.AddItem "Dispatch"
.AddItem "Transportation"
End With
cboDepartment.Value = ""
With cboCourse
.AddItem "Access"
.AddItem "Excel"
.AddItem "PowerPoint"
.AddItem "Word"
.AddItem "FrontPage"
End With
cboCourse.Value = ""
optIntroduction = True
chkLunch = False
chkVegetarian = False
txtName.SetFocus
End Sub

The button on worksheet was

Sub OpenCourseBookingForm()
frmCourseBooking.Show
End Sub
 
Upvote 0
I can send you the file to an email if you give me one. It is very small. I plan on creating the fields I need myself based off what i see here from this VB program. As I said I am new to VB so I am learning.
 
Upvote 0
I was able to create the email as an excel spreadsheet but I want it in the form format. I sent several test to myself which worked perfectly. I am still looking at it.
 
Upvote 0

Forum statistics

Threads
1,224,584
Messages
6,179,691
Members
452,938
Latest member
babeneker

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