は
は、説明のためのコメントを参照してください...もちろん質問はかなり曖昧だったので、特定のニーズに合わせてそれを適応させる、あなたが望む何をすべきマクロです。
Sub sendEmail()
' Set up outlook objects for emailing
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)
' Body text for the email
Dim strbody As String
strbody = "This text in the body of your email"
' Strings to contain the email addresses
Dim sendTo As String
sendTo = ""
Dim sendCC As String
sendCC = ""
Dim sendBCC As String
sendBCC = ""
' The cell containing the email address (loop variable)
Dim emailCell As Range
With ActiveSheet
' Cycle through email addresses, from B3 to one before next blank cell in column
For Each emailCell In .Range("B3", .Range("B3").End(xlDown))
' Check each TRUE/FALSE column in same row, add email addresses accordingly
If .Cells(emailCell.Row, "D").Text = "TRUE" Then
sendTo = sendTo & "; " & emailCell.Text
End If
If .Cells(emailCell.Row, "F").Text = "TRUE" Then
sendCC = sendCC & "; " & emailCell.Text
End If
If .Cells(emailCell.Row, "H").Text = "TRUE" Then
sendBCC = sendBCC & "; " & emailCell.Text
End If
Next emailCell
End With
' Generate email in outlook objects defined above
On Error Resume Next
With OutMail
.To = sendTo
.CC = sendCC
.BCC = sendBCC
.Subject = "Subject Message Here"
.HTMLBody = strbody
.Display
' If you don't want to display the email before sending it,
' simply use .Send instead of .Display
End With
On Error GoTo 0
End Sub
何を試しましたか? –
コードの一部が機能していませんか?もしそうなら、あなたのコードを質問に貼り付けて、どこに問題があるのかを教えてください。しかし、あなたの問題が何かについての手がかりがなくても、私たちが助けになる答えを推測することは非常に少ない**可能性があります。 – YowE3K
あなたが試したことを示すことに加えて、*どのようにメールを送信しようとしていますか? Outlookで? Gmail?ホットメール? Yahoo? Lotus Notes? ... [お問い合わせ方法](https://stackoverflow.com/help/how-to-ask)をご覧ください。 – BruceWayne