Subject line in E-mail

  • Thread starter Thread starter Ola Sigurdh
  • Start date Start date
O

Ola Sigurdh

Hello.

I Found this vba code via a google search which I changed just a little
bit. It does what I want besides that I want it to generate a subject line
in the E-mail that is Avräkning + the worksheet name. How would I do that.
Sub mail()
For a = 1 To ThisWorkbook.Worksheets.Count - 1
With Sheets(Sheets.Count)
Dim MyArr As Variant
MyArr = .Range(.Cells(1, a), .Cells(Rows.Count, a).End(xlUp))
End With
Sheets(a).Copy
ActiveWorkbook.SendMail MyArr, "Avräkning"
ActiveWorkbook.Close False
Next
End Sub

TIA

Ola Sigurdh
 
Back
Top