Last line sent in email

isleofman

New Member
Joined
Jan 12, 2010
Messages
38
Hi,

I'm using a VB script that sends the spreadsheet to an email address using the defined cells.

How can I write the VB to always include the last line when additions are made?

Code:
Sub Send()
   ActiveSheet.Range("A1:J130").Select
 
    Columns("A:A").Hidden = False
    Columns("B:B").Hidden = False
    Columns("C:C").Hidden = False
    Columns("D:D").Hidden = True
    Columns("E:E").Hidden = False
 
   ActiveWorkbook.EnvelopeVisible = False
 
   With ActiveSheet.MailEnvelope
      .Introduction = "Sheet"
      .Item.To = "[EMAIL="xxx@xxxx.com"]xxx@xxxx.com[/EMAIL]"
      .Item.Subject = "Sheet"
      .Item.Send
 
    End With
End Sub

Code:
Sub Save()
    ActiveSheet.Range("A1:J130").Select
 
    Columns("A:A").Hidden = False
    Columns("B:B").Hidden = False
    Columns("C:C").Hidden = False
    Columns("D:D").Hidden = False
    Columns("E:E").Hidden = False
 
    Range("E9:E19,E21:E37,E39:E56,E66:E90,E92:E94,E96:E103,E105:E113,E115:E121").ClearContents
 
    ActiveWorkbook.Save
    Application.Quit
 
End Sub
 

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
im sorry i dont understand, you have specified ranges which means whatever you put in there will be included....
 
Upvote 0
Try

Code:
LR = Range("A" & Rows.Count).End(xlUp).Row
Range("A1:J" & LR).Select
 
Upvote 0

Forum statistics

Threads
1,214,976
Messages
6,122,541
Members
449,089
Latest member
davidcom

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