Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Ola
ActiveWorkbook.SendMail MyArr, "Avräkning" & Sheets(a).Name For other examples see http://www.rondebruin.nl/sendmail.htm -- Regards Ron de Bruin (Win XP Pro SP-1 XL2000-2003) www.rondebruin.nl "Ola Sigurdh" wrote in message ... 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 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thank´s Ron
I will give it a try now. (Trying to learn some VBA) Óla Sigurdh "Ron de Bruin" skrev i meddelandet ... Hi Ola ActiveWorkbook.SendMail MyArr, "Avräkning" & Sheets(a).Name For other examples see http://www.rondebruin.nl/sendmail.htm -- Regards Ron de Bruin (Win XP Pro SP-1 XL2000-2003) www.rondebruin.nl "Ola Sigurdh" wrote in message ... 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
e mail same body different subject | Excel Discussion (Misc queries) | |||
Hyperlink mailto - ref cell for mail subject | Excel Worksheet Functions | |||
Variables in the subject line of an e-mail hyperlink | Excel Discussion (Misc queries) | |||
Hyperlinking e-mail addresses from a listing to show a subject lin | Excel Discussion (Misc queries) | |||
Customize Subject Line | Excel Discussion (Misc queries) |