I have a userform that has several textboxes to send an email. I would like the textbox value to be declared as a variable that can then be referenced in the email code except I don't know how to do it. Here is what I have so far:
Code:
Dim TOrngeAddresses As Range, TOrngeCell As Range, TOstrRecipients As String
Dim CCrngeAddresses As Range, CCrngeCell As Range, CCstrRecipients As String
Dim BCCrngeAddresses As Range, BCCrngeCell As Range, BCCstrRecipients As String
Dim iMsg As Object
Dim iConf As Object
Dim strbody As String
Dim Flds As Variant
'Find Emails of multiple people sending as "to"
Set TOrngeAddresses = UserForm2.TextBox1
For Each TOrngeCell In TOrngeAddresses.Cells
TOstrRecipients = TOstrRecipients & "; " & TOrngeCell.Value
Next
'Find Emails of multiple people sending as "CC"
Set CCrngeAddresses = TextBox2
For Each CCrngeCell In CCrngeAddresses.Cells
CCstrRecipients = CCstrRecipients & "; " & CCrngeCell.Value
Next
'Find Emails of multiple people sending as "BCC"
Set BCCrngeAddresses = TextBox3
For Each BCCrngeCell In BCCrngeAddresses.Cells
BCCstrRecipients = BCCstrRecipients & "; " & BCCrngeCell.Value
Next