ibianchini123
New Member
- Joined
- Jul 6, 2016
- Messages
- 2
Hi everyone,
What I am trying to do is basically create a macro that select all rows that have the same text in the cell and send the email.
Select the header and the paths that are the same and send via email to a specific destinatary, in other words:
<tbody>
</tbody>
Send to: junior@email.com
<tbody>
</tbody>
Send to: marcos@email.com
<tbody>
</tbody>
This is the VBA code that I trying to make (incomplete):
Sub Send_Range()
' Select the range of cells on the active worksheet.
'ActiveSheet.Range("A:A").Select
'============================================
Range("A2").Select
i = Mid(ActiveCell.Value, 4, Len(ActiveCell.Value))
While Len(ActiveCell.Value) < 4
'Encontrar celula com conteudo de diretorio valido
ActiveCell.Offset(1, 0).Select
Wend
'Pegar o conteudo da celula e armazenar em variavel
ConteudoLinnha = Range(Selection, Selection.End(xlToRight))
Selection.Copy
conteudo = Selection.Copy
MsgBox conteudo
'=============================================
' Show the envelope on the ActiveWorkbook.
ActiveWorkbook.EnvelopeVisible = True
' Set the optional introduction field thats adds
' some header text to the email body. It also sets
' the To and Subject lines. Finally the message
' is sent.
With ActiveSheet.MailEnvelope
.Introduction = "body."
.Item.To = "email"
.Item.Subject = "Test"
.Item.Send
End With
End Sub
What I am trying to do is basically create a macro that select all rows that have the same text in the cell and send the email.
Select the header and the paths that are the same and send via email to a specific destinatary, in other words:
Path | Account Type | Account | Display Name | Permission (Simple) |
I:\Alt_Investments | Group | CSFB\_FaosaoAlt_InvestmentsC | _FaosaoAlt_InvestmentsC | Modify |
I:\Alt_Investments | Group | CSFB\_FaosaoAlt_InvestmentsR | _FaosaoAlt_InvestmentsR | Read and Execute |
I:\Alt_Investments | Group | CSFB\_FaosaoAltInvestments_BloombergR | _FaosaoAltInvestments_BloombergR | List Folder Contents |
I:\Alt_Investments | Group | CSFB\_FaosaoAltInvestments_SecretariasC | _FaosaoAltInvestments_SecretariasC | List Folder Contents |
I:\Alt_Investments | Group | CSFB\_FaosaoAltInvestments_SecretariasR | _FaosaoAltInvestments_SecretariasR | List Folder Contents |
I:\Alt_Investments | Group | CSFB\_FAOsaoDatF | _FAOsaoDatF | Full Control |
I:\Alt_Investments_Initiatives | Group | CSFB\_FaosaoAltInvestments_InitiativesC | _FaosaoAltInvestments_InitiativesC | Modify |
I:\Alt_Investments_Initiatives | Group | CSFB\_FaoSaoAltInvestments_InitiativesL | _FaoSaoAltInvestments_InitiativesL | List Folder Contents |
I:\Alt_Investments_Initiatives | Group | CSFB\_FaosaoAltInvestments_InitiativesR | _FaosaoAltInvestments_InitiativesR | Read and Execute |
I:\Alt_Investments_Initiatives | Group | CSFB\_FAOsaoDatF | _FAOsaoDatF | Full Control |
I:\Analise | Group | CSFB\_EQTsaoAnaliseWorkingC | _EQTsaoAnaliseWorkingC | List Folder Contents |
I:\Analise | Group | CSFB\_EQTsaoAnaliseWorkingR | _EQTsaoAnaliseWorkingR | List Folder Cont |
<tbody>
</tbody>
Send to: junior@email.com
Path | Account Type | Account | Display Name | Permission (Simple) |
I:\Alt_Investments | Group | CSFB\_FaosaoAlt_InvestmentsC | _FaosaoAlt_InvestmentsC | Modify |
I:\Alt_Investments | Group | CSFB\_FaosaoAlt_InvestmentsR | _FaosaoAlt_InvestmentsR | Read and Execute |
I:\Alt_Investments | Group | CSFB\_FaosaoAltInvestments_BloombergR | _FaosaoAltInvestments_BloombergR | List Folder Contents |
I:\Alt_Investments | Group | CSFB\_FaosaoAltInvestments_SecretariasC | _FaosaoAltInvestments_SecretariasC | List Folder Contents |
I:\Alt_Investments | Group | CSFB\_FaosaoAltInvestments_SecretariasR | _FaosaoAltInvestments_SecretariasR | List Folder Contents |
<tbody>
</tbody>
Send to: marcos@email.com
Path | Account Type | Account | Display Name | Permission (Simple) |
I:\Alt_Investments_Initiatives | Group | CSFB\_FaosaoAltInvestments_InitiativesC | _FaosaoAltInvestments_InitiativesC | Modify |
I:\Alt_Investments_Initiatives | Group | CSFB\_FaoSaoAltInvestments_InitiativesL | _FaoSaoAltInvestments_InitiativesL | List Folder Contents |
I:\Alt_Investments_Initiatives | Group | CSFB\_FaosaoAltInvestments_InitiativesR | _FaosaoAltInvestments_InitiativesR | Read and Execute |
I:\Alt_Investments_Initiatives | Group | CSFB\_FAOsaoDatF | _FAOsaoDatF | Full Control |
<tbody>
</tbody>
This is the VBA code that I trying to make (incomplete):
Sub Send_Range()
' Select the range of cells on the active worksheet.
'ActiveSheet.Range("A:A").Select
'============================================
Range("A2").Select
i = Mid(ActiveCell.Value, 4, Len(ActiveCell.Value))
While Len(ActiveCell.Value) < 4
'Encontrar celula com conteudo de diretorio valido
ActiveCell.Offset(1, 0).Select
Wend
'Pegar o conteudo da celula e armazenar em variavel
ConteudoLinnha = Range(Selection, Selection.End(xlToRight))
Selection.Copy
conteudo = Selection.Copy
MsgBox conteudo
'=============================================
' Show the envelope on the ActiveWorkbook.
ActiveWorkbook.EnvelopeVisible = True
' Set the optional introduction field thats adds
' some header text to the email body. It also sets
' the To and Subject lines. Finally the message
' is sent.
With ActiveSheet.MailEnvelope
.Introduction = "body."
.Item.To = "email"
.Item.Subject = "Test"
.Item.Send
End With
End Sub