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

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
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,515
Messages
6,119,973
Members
448,933
Latest member
Bluedbw

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