Ir para conteúdo
Fórum Script Brasil

Souza77

Membros
  • Total de itens

    1
  • Registro em

  • Última visita

Posts postados por Souza77

  1.  

    Sou iniciante no universo da programação.

    Tenho uma planilha de medição que eu uso e gostaria que 7 dias

    antes de uma determinada data, fosse enviado um email a determinados

    endereços alertando que a medição da obra deve ser realizada.

    O meu progresso esta colado.

     

    Poderiam me dar uma orientação, mostrar o caminho que devo seguir.

    o código base que estou usando é uma cópia de um site americana.

    Porem na sintaxe do comando if estou encontrando problemas para

    fazer ela funcionar.

     

    Private Sub Worksheet_Change(ByVal Target As Range)
        Dim OutApp As Object
        Dim OutMail As Object
        Dim texto As String

        Set OutApp = CreateObject("Outlook.Application")
        Set OutMail = OutApp.CreateItem(0)

        linha = ActiveCell.Row - 1
        If Target.Address = "$H$" & linha Then

            If Plan1.Cells(E, 50) = "enviar email" Then
            If Plan1.Cells(E, 51) = "enviar email" Then
            If Plan1.Cells(E, 52) = "enviar email" Then
            If Plan1.Cells(E, 53) = "enviar email" Then
            If Plan1.Cells(E, 54) = "enviar email" Then
            If Plan1.Cells(E, 55) = "enviar email" Then
            If Plan1.Cells(E, 56) = "enviar email" Then
            If Plan1.Cells(E, 57) = "enviar email" Then
                  texto = "Faltam" & Plan1.Cells(D, 50) & _
                        "Favor realizar a:" & Plan1.Cells(C, 50) & _
                        "Data final:" & Plan1.Cells(L, 6) & _
                        "Grato " & Plan1.Cells(C, 48)
            End If

            With OutMail
                .To = "m.souza@gamafire.com.br"
                .cc = "m.souza@gamafire.com.br"
                .BCC = ""
                .Subject = "Realizar medição"
                .HTMLBody = texto
                .Send
            End With
            On Error GoTo 0

            Set OutMail = Nothing
            Set OutApp = Nothing
        End If
        End If
        End If
        End If
        End If
        End If
        End If
        End If
    End Sub

     Grato.

     

    Planilha.jpg

×
×
  • Criar Novo...