freelancerchn
New Member
- Joined
- Sep 19, 2014
- Messages
- 6
Good day all!
First, I must admit that this website has helped me in many instances for my no-vice coding skills.
Now, I am in a fix. I am sincerely looking out for help from fellow members in performing the following tasks.
1. Copy a range of cells from active sheet and put that in body of email.
2. Copy a range of cells in another sheet in the active workbook and put that as an attachment.
3. Now both the above has to be done in the same email.
The code I currently use for first situation is below;
=====
Sub Lo()
' Select the range of cells on the active worksheet.
Range("E65536").End(xlUp).Offset(1, 0).Select
Range(ActiveCell, ActiveCell.Offset(0, 10)).Select
Range(Selection, Selection.End(xlUp)).Select
Range(Selection, Selection.End(xlUp)).Select
Range(Selection, Selection.End(xlUp)).Select
Range(Selection, Selection.End(xlUp)).Select
' Show the envelope on the ActiveWorkbook.
ActiveWorkbook.EnvelopeVisible = True
With ActiveSheet.MailEnvelope
.Introduction = "Hi Team"
.Item.To = "abc@abc.com"
.Item.CC = ""
.Item.Subject = "Subject line"
End With
=====
It would really help if somebody can help me consolidate the code. If this works out I can save a lot of time in reports.
Thanks in advance for any assistance guys!
First, I must admit that this website has helped me in many instances for my no-vice coding skills.
Now, I am in a fix. I am sincerely looking out for help from fellow members in performing the following tasks.
1. Copy a range of cells from active sheet and put that in body of email.
2. Copy a range of cells in another sheet in the active workbook and put that as an attachment.
3. Now both the above has to be done in the same email.
The code I currently use for first situation is below;
=====
Sub Lo()
' Select the range of cells on the active worksheet.
Range("E65536").End(xlUp).Offset(1, 0).Select
Range(ActiveCell, ActiveCell.Offset(0, 10)).Select
Range(Selection, Selection.End(xlUp)).Select
Range(Selection, Selection.End(xlUp)).Select
Range(Selection, Selection.End(xlUp)).Select
Range(Selection, Selection.End(xlUp)).Select
' Show the envelope on the ActiveWorkbook.
ActiveWorkbook.EnvelopeVisible = True
With ActiveSheet.MailEnvelope
.Introduction = "Hi Team"
.Item.To = "abc@abc.com"
.Item.CC = ""
.Item.Subject = "Subject line"
End With
=====
It would really help if somebody can help me consolidate the code. If this works out I can save a lot of time in reports.
Thanks in advance for any assistance guys!