Hi,
I have the below code (a lot of it is omitted for relevance).
Essentially, I have a worksheet. Column A has area names, B & C have associated email addresses.
I can write code that will send an email to the associated email easily enough, but I'm having great difficulty with selecting the Area.
I need to be able to populate a combo box based on A:A, once a selection is made, that selection is recorded in Area (string), but I also need the cell reference of where the selected area in A:A is so I can offset to get the recipients if that makes sense. Once the selection is made, the box goes away (hide as a I understand it rather than unload or selection data is lost?), the rest of the code resumes (which opens file dialogue for an attachment selection to be sent with an email).
This seems like something that should be simple but I'm unable to build a solution that works properly.
For further reference, I intent to initiate the userform by running the macro from the quick access tool bar.
Thanks
I have the below code (a lot of it is omitted for relevance).
Essentially, I have a worksheet. Column A has area names, B & C have associated email addresses.
I can write code that will send an email to the associated email easily enough, but I'm having great difficulty with selecting the Area.
I need to be able to populate a combo box based on A:A, once a selection is made, that selection is recorded in Area (string), but I also need the cell reference of where the selected area in A:A is so I can offset to get the recipients if that makes sense. Once the selection is made, the box goes away (hide as a I understand it rather than unload or selection data is lost?), the rest of the code resumes (which opens file dialogue for an attachment selection to be sent with an email).
This seems like something that should be simple but I'm unable to build a solution that works properly.
VBA Code:
Sub Approval()
Dim Area As String
Dim Recipient1 As String
Dim Recipient2 As String
Depot = DepotCell(??)
Recipient1 = DepotCell.Offset(, 1)
Recipient2 = DepotCell.Offset(, 2)
Subject = Area & " Approval"
'code omitted
.To = Recipient1 & ";" &Recipient2
End Sub
For further reference, I intent to initiate the userform by running the macro from the quick access tool bar.
Thanks