hola a migos a continuacion les muestro el codigo para enviar por mail una
seleccion de un rango, adicionalmente les pido su apoyo para complementarlo
necesito enviar copia a otra persona por tanto no se como puedo integrar la
instruccion. saludos muchas gracias...
Sub Mail_resumen()
Dim sh As Worksheet
Dim wb As Workbook
Dim strdate As String
Dim source As Range
Dim dest As Workbook
Application.ScreenUpdating = False
For Each sh In ThisWorkbook.Worksheets
If sh.Range("a20").Value Like "?*@?*.?*" Then
strdate = Format(Now, "dd-mm-yy h-mm-ss")
Set source = Nothing
On Error Resume Next
Set source = Range("b1:n21").SpecialCells(xlCellTypeVisible)
On Error GoTo 0
If source Is Nothing Then
MsgBox "The source is not a range or the sheet is protect, please
correct and try again.", vbOKOnly
Exit Sub
End If
Application.ScreenUpdating = False
Set dest = Workbooks.Add(xlWBATWorksheet)
source.Copy
With dest.Sheets(1)
.Cells(1).PasteSpecial Paste:=8
.Cells(1).PasteSpecial xlPasteValues, , False, False
.Cells(1).PasteSpecial xlPasteFormats, , False, False
.Cells(1).Select
Application.CutCopyMode = False
ActiveWindow.DisplayGridlines = False
End With
Set wb = ActiveWorkbook
With wb
.SaveAs "ResumenPlan" & ".xls"
.Sendmail ActiveSheet.Range("a20").Value, _
"Resumen de presupuesto"
.ChangeFileAccess xlReadOnly
Kill .FullName
.Close False
End With
End If
Next sh
Application.ScreenUpdating = True
End Sub
Leer las respuestas