Te anexo las macros
Sub ValidaryEnviar()
'Act.Por.Dante Amor
Application.ScreenUpdating = False
Application.DisplayAlerts = False
If comprobarceldas Then
If validar_seccion Then
Call EnviarCorreo
MsgBox "Correo enviado"
End If
End If
End Sub
'
Sub EnviarCorreo()
'Por.Dante Amor
Set l1 = ThisWorkbook
Set h1 = l1.ActiveSheet
ruta = l1.Path & "\"
h1.Copy
Set l2 = ActiveWorkbook
archivo = "requerimiento_creación " & Format(Date, "dd-mm-yyyy") & ".xls"
l2.SaveAs Filename:=ruta & archivo, FileFormat:=xlNormal
l2.Close
Set dam = CreateObject("outlook.application").createitem(0)
Set h2 = Sheets("DATOS")
Set b = h2.Columns("L").Find([L39], lookat:=xlWhole)
If Not b Is Nothing Then
correo = b.Offset(0, 1)
dam.To = correo
dam.Subject = "Autorización para creación de Proyecto en Primavera"
dam.body = "Favor confirmar solicitud"
dam.Attachments.Add ruta & archivo
dam.send
'dam.display
End If
End Sub
Function validar_seccion()
validar_seccion = False
If ActiveSheet.diseño = Empty And ActiveSheet.construccion = Empty Then
MsgBox "Selecciona SECCION", vbInformation, "PMO"
Range("I9").Select
Exit Function
ElseIf ActiveSheet.diseño = True And ActiveSheet.construccion = True Then
MsgBox "Debes Seleccionar sólo una SECCION", vbInformation, "PMO"
Range("I9").Select
Exit Function
End If
validar_seccion = True
End Function
Function comprobarceldas()
comprobarceldas = False
If Range("G8") = Empty And Range("G8").HasFormula = False Then
MsgBox "Ingresa NOMBRE", vbInformation, "PMO"
Range("G8").Select
Exit Function
End If
If Range("G9") = Empty And Range("G9").HasFormula = False Then
MsgBox "Ingresa RUT", vbInformation, "PMO"
Range("F9").Select
Exit Function
End If
If Range("G10") = Empty And Range("G10").HasFormula = False Then
MsgBox "Ingresa ETAPA", vbInformation, "PMO"
Range("G10").Select
Exit Function
End If
If Range("G12") = Empty And Range("G12").HasFormula = False Then
MsgBox "Ingresa NOMBRE DE PROYECTO", vbInformation, "PMO"
Range("G12").Select
Exit Function
End If
If Range("G13") = Empty And Range("G13").HasFormula = False Then
MsgBox "Ingresa TIPO", vbInformation, "PMO"
Range("G13").Select
Exit Function
End If
If Range("M14") = 0 And Range("g14") = "" Then
MsgBox "Falta Información del código BIP", vbInformation, "PMO"
Range("F14").Select
Exit Function
End If
If Range("G15") = Empty And Range("G15").HasFormula = False Then
MsgBox "Ingresa RATE", vbInformation, "PMO"
Range("G15").Select
Exit Function
End If
If Range("G17") = Empty And Range("G17").HasFormula = False Then
MsgBox "Ingresa ADMINISTRACION ZONAL", vbInformation, "PMO"
Range("G17").Select
Exit Function
End If
If Range("G19") = Empty And Range("G19").HasFormula = False Then
MsgBox "Ingresa COMPETENCIA", vbInformation, "PMO"
Range("G19").Select
Exit Function
End If
If Range("F23") = Empty And Range("F23").HasFormula = False Then
MsgBox "Ingresa JP RESPONSABLE", vbInformation, "PMO"
Range("F23").Select
Exit Function
End If
If Range("F25") = Empty And Range("F25").HasFormula = False Then
MsgBox "Ingresa JP DISEÑO", vbInformation, "PMO"
Range("F25").Select
Exit Function
End If
If Range("F27") = Empty And Range("F27").HasFormula = False Then
MsgBox "Ingresa JP CONSTRUCCION", vbInformation, "PMO"
Range("F27").Select
Exit Function
End If
comprobarceldas = True
End Function
':)
':)