SendMail to linked Drop Down value?

ABGirl

New Member
Joined
Jun 12, 2011
Messages
2
Hi All,

Now I don't know if this is even possible & think it's 2 (or maybe 3!) queries! But here goes!

I have a user form that I want to be sent onto an 'approver' once completed who would be selected from a drop down list. Once the approver is happy they need to click on a submit button to send it onto a further processing mailbox.
I already have the 'Submit' to processing areas bit sorted - but ideally want that button to be hidden until it gets to the 'approver'.
Also I don't really want a list of email addresses in the drop down 'select approver' box, would prefer to have a list of names which then translate to email addresses.

So the 3 things are:
  • Can I create a drop down list with actual names (e.g. BOB, DAVE, IAN etc) that then translate to email addresses once selected?
  • Can I then have a 'Send to Approver' button which doesnt rely on over 100 if statements to send the mail?
  • Can I 'hide' the Submit to processing area button until the sheet reaches the Approver?

Am hoping this makes some sense!
confused.gif


Thanks in advance

 

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result
Welcome to the Forum,

Create a list of names in one coulmn and then the email addresses in the next then you can refer to the names and then use an offset to send to the email address.

Does your form indicate an approver, if so then it is a simple case of using a hide method until an approver has been selected.

This sample code will fill a combo box

Private Sub UserForm_Initialize()
Sheets("Sheet1").Activate
Range("B2").Select
Do Until ActiveCell.Value = ""
Me.cboNames.AddItem ActiveCell.Value
ActiveCell.Offset(1, 0).Select

Loop
End Sub

Based on this sample sheet

Excel Workbook
BC
2NamesEmail
3Johnjohn.smith@bbc.co.uk
4Billbill.jones@bbc.co.uk
5Allanallan.white@bbc.co.uk
Sheet1
 
Upvote 0
Fab - thanks for this - currently the 'approver' is in a drop down list on the front page of the form - but there was no link to the email address - now I just need to work out the next bits of the puzzle!

Thanks for the help :)
 
Upvote 0
Take a look at this, it uses 2 columns in a combo box, so you will see the name and email address to check to see if works, then you can refer to the second column to send the emails, but hide the column or reduce the size to zero. This code goes behind the form on initialize or activate.

Dim iRow As Long
Dim myCell As Range
With Me.ComboBox1
.ColumnCount = 2
.BoundColumn = 2
For iRow = 1 To 20 Step 3
Set myCell = Worksheets("sheet1").Cells(iRow, 1)
.AddItem myCell.Value
.List(.ListCount - 1, 1) = myCell.Offset(0, 1).Value
Next iRow
End With
 
Upvote 0

Forum statistics

Threads
1,224,590
Messages
6,179,750
Members
452,940
Latest member
rootytrip

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