Copy selection paste into email body, ned assistance

pujo

Well-known Member
Joined
Feb 19, 2009
Messages
710
Office Version
  1. 2019
  2. 2013
Platform
  1. Windows
Hell all,
I have this logic that works well, but I need to copy a range of cells say B7:G38 and paste it into the body of the email.
Can anyone please assist me in getting this going, I would greatly appreciate the help, or direction.
Thanks,
Pujo

Here is what I am working with.
Code:
Private Sub CommandButton2_Click()
Dim OL As Object
    Dim EmailItem As Object
    Dim Wb As Workbook
    ActiveSheet.Unprotect Password:="xxx"
    Application.ScreenUpdating = False
    Set OL = CreateObject("Outlook.Application")
    Set EmailItem = OL.CreateItem(olMailItem)
    Set Wb = ActiveWorkbook
    Wb.Save
    SigString = "C:\Documents and Settings\" & Environ("username") & _
                "\Application Data\Microsoft\Signatures\*.htm"
    Dim Try As String
    Try = Dir(SigString)
    If Try <> "" Then
    SigString = "C:\Documents and Settings\" & Environ("username") & _
                "\Application Data\Microsoft\Signatures\" & Try
        Signature = GetBoiler(SigString)
    Else
        Signature = ""
    End If
    With EmailItem
                .Subject = "Daily Crew Activity" & " " & Format(Now, "mmm-dd-yy")
                 strbody = "Good Morning, Please See Attached File."
                
        .To = [EMAIL="me@me.com"]me@me.com[/EMAIL]
        .Attachments.Add Wb.FullName
        .HTMLBody = strbody & "" & Signature
        .Display
        '.Send
    End With
    
    Application.ScreenUpdating = True
    Set Wb = Nothing
    Set OL = Nothing
    Set EmailItem = Nothing
    With Application
        .ScreenUpdating = True
        .EnableEvents = True
        ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True, Password:="xxx"
End With
End Sub
 

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December

Forum statistics

Threads
1,224,583
Messages
6,179,678
Members
452,937
Latest member
Bhg1984

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top