Saltar al contenido
View in the app

A better way to browse. Learn more.

Ayuda Excel

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Enviar Rango de Celdas vía Excel por Outlook

publicado

Estimados,

Estoy usando un código para remitir un rango de celdas seleccionadas desde una hoja de Excel vía Outlook,  lo encontré entre los casos resueltos de la página http://www.rondebruin.nl/win/s1/outlook/bmail3.htm, mi problema es que quisiera modificarlo para que los rangos remitidos puedan ser uno predeterminado que corresponde a los títulos (Rango A1:J3) y que el otro rango corresponda a las celdas que seleccione en la hoja con el cursor.

Agradeceré vuestra ayuda ya que no he encontrado vueltas al caso.

Ejemplo.xlsm

Featured Replies

publicado

Hola, 

Prueba con esto: 

Sub Send_Selection_Or_ActiveSheet_with_MailEnvelope()
'Working in Excel 2002-2016
    Dim Sendrng As Range
    Dim rangotitulos As Range
    Dim rangoglobal As Range

    On Error GoTo StopMacro

    With Application
        .ScreenUpdating = False
        .EnableEvents = False
    End With

    'Rango de los títulos
    Set rangotitulos = Sheets("Automoviles").Range("A1:J3")

    'Note: if the selection is one cell it will send the whole worksheet
    Set Sendrng = Selection
    
    Set rangoglobal = Union(rangotitulos, Sendrng)

    

    'Create the mail and send it
    With rangoglobal

        ActiveWorkbook.EnvelopeVisible = True
        With .Parent.MailEnvelope

            ' Set the optional introduction field thats adds
            ' some header text to the email body.
            .Introduction = "Estimados" + vbNewLine + "A continuación remitimos el listado de propuestas a ser entregadas para su emisión" + vbNewLine + "Quedamos atentos ante cualquier duda o consulta"

            With .Item
                .To = "vfretes@yacyreta.com.py"
                .CC = ""
                .BCC = ""
                .Subject = "Remisión de Propuestas " & Range("B3")
                '.Send
            End With

        End With
    End With

StopMacro:
    With Application
        .ScreenUpdating = True
        .EnableEvents = True
    End With
    ActiveWorkbook.EnvelopeVisible = False

End Sub

Debes tener en cuenta que si no seleccionas bien el rango con los datos saldrán cosas raras.

He puesto '.Send para que veas como se genera el mensaje de correo antes de enviarlo. Quita la coma si quieres que se envíe directamente.

publicado
  • Autor

Hola dogwall, muchas gracias por tu ayuda, he probado el código y selecciona correctamente el rango que es dinámico, pero los títulos no los ha copiado al correo, adjunto una muestra

lksndgf65.png

  • 3 weeks later...
publicado
  • Autor

Estimados,

Aguardo vuestra ayuda por favor!

Archivado

Este tema está ahora archivado y está cerrado a más respuestas.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.