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?
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