Sending a row of a table throug email

lpcysmi

New Member
Joined
Jul 11, 2017
Messages
3
Hello:

I am doing a macro to be able to send info of a table to ask for a project status

Code:
Sub Button2_Click()

   
   ' Select the range of cells on the active worksheet.
   Dim Copyrange1 As String
   Dim Copyrange2 As String
   NU = Range("A2").Value
   
      
   Let Copyrange1 = "K" & 5 & ":" & "P" & 7
   
   Let Copyrange2 = "K" & NU & ":" & "P" & NU
   
   Range(Copyrange1, Copyrange2).Select
   
   
   ' Show the envelope on the ActiveWorkbook.
   ActiveWorkbook.EnvelopeVisible = True
   
   ' Set the optional introduction field thats adds
   ' some header text to the email body. It also sets
   ' the To and Subject lines. Finally the message
   ' is sent.
   Dim s As String
   s = "Hello" & vbCrLf & "Please process the following order" & vbCrLf & "Please confirm ammount and delivery date" & vbCrLf & "Best Regards"
   With ActiveSheet.MailEnvelope
      .Introduction = s
      .Item.To = Range("S" & NU).Value
      .Item.Subject = "My subject"
      .Item.Send
   End With

End Sub


Where NU is the row number wanted

Copyrange1 is the table heading and Copyrange2 is the row of the info wanted

with the current code I do not get ONLY the heading and the row i want. I get all the rows in between

How do I fix this????


PS: I also want to add my outlook signature to the email
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.

Forum statistics

Threads
1,223,214
Messages
6,170,772
Members
452,353
Latest member
strainu

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